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



path_join › WordPress Function

Desde2.5.0
Obsoleton/a
path_join ( $base, $path )
Parâmetros: (2)
  • (string) $base Base path.
    Required: Yes
  • (string) $path Path relative to $base.
    Required: Yes
Retorna:
  • (string) The path with the base or absolute path.
Definido em:
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.


Fonte

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

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