wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



path_join › WordPress Function

Depuis2.5.0
Dépréciéen/a
path_join ( $base, $path )
Paramètres: (2)
  • (string) $base Base path.
    Requis: Oui
  • (string) $path Path relative to $base.
    Requis: Oui
Retourne:
  • (string) The path with the base or absolute path.
Défini(e) dans:
Codex:

Joins two filesystem paths together.

For example, 'give me $path relative to $base'. If the $path is absolute, then it the full path is returned.


Source

function path_join( $base, $path ) {
	if ( path_is_absolute( $path ) ) {
		return $path;
	}

	return rtrim( $base, '/' ) . '/' . $path;
}