wpseek.com
A WordPress-centric search engine for devs and theme authors



path_join › WordPress Function

Since2.5.0
Deprecatedn/a
path_join ( $base, $path )
Parameters: (2)
  • (string) $base Base path.
    Required: Yes
  • (string) $path Path relative to $base.
    Required: Yes
Returns:
  • (string) The path with the base or absolute path.
Defined at:
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;
}