path_join() – Joins two filesystem paths together.

You appear to be a bot. Output may be restricted

Description

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.

Usage

$string = path_join( $base, $path );

Parameters

$base
( string ) required – Base path.
$path
( string ) required – Path relative to $base.

Returns

string The path with the base or absolute path.

Source

File name: wordpress/wp-includes/functions.php
Lines:

1 to 7 of 7
function path_join( $base, $path ) {
  if ( path_is_absolute( $path ) ) {
    return $path;
  }

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

 View on GitHub View on Trac