wpseek.com
WordPress开发者和主题制作者的搜索引擎



path_join › WordPress Function

Since2.5.0
已弃用n/a
path_join ( $base, $path )
参数: (2)
  • (string) $base Base path.
    Required: Yes
  • (string) $path Path relative to $base.
    Required: Yes
返回:
  • (string) The path with the base or absolute path.
定义在:
文档:

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.


源码

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

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