lp__normalize_path( $path )
This function replaces backslashes with forward slashes for Windows systems and ensures that no duplicate slashes exist in the path.
Plugin
Namespace
Launchpad
Parameters
string
$path
Path to normalize.
Return
string
Normalized path.
Source
File: \includes\lp-utility-functions.php
function lp__normalize_path( $path ) {
$normalized_path = '';
if ( function_exists( 'wp_normalize_path' ) ) {
$normalized_path = wp_normalize_path( $path );
} else {
$normalized_path = str_replace( '\\', '/', $path );
$normalized_path = preg_replace( '|/+|', '/', $normalized_path );
}
return $normalized_path;
}