Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_normalize_path ›

Desde3.9.0
Obsoleton/a
wp_normalize_path ( $path )
Parâmetros:
  • (string) $path Path to normalize.
    Required: Yes
Retorna:
  • (string) Normalized path.
Definido em:
Codex:
Log de mudanças:
  • 4.4.0
  • 4.5.0

Normalize a filesystem path.

On windows systems, replaces backslashes with forward slashes and forces upper-case drive letters. Allows for two leading slashes for Windows network shares, but ensures that all other duplicate slashes are reduced to a single.



Fonte

function wp_normalize_path( $path ) {
	$path = str_replace( '\\', '/', $path );
	$path = preg_replace( '|(?<=.)/+|', '/', $path );
	if ( ':' === substr( $path, 1, 1 ) ) {
		$path = ucfirst( $path );
	}
	return $path;
}