函数原型
home_url( string $path = ”, string|null $scheme = null ): string
函数描述
Retrieves the URL for the current site where the front end is accessible.
是否弃用
未弃用
函数参数
-
$path
string
Optional - Path relative to the home URL.
Default:
'' -
$scheme
string|null
Optional - Scheme to give the home URL context. Accepts
'http','https','relative','rest', or null.Default:
null
函数返回值
string Home URL link with optional path appended.
函数位置
File: wp-includes/link-template.php.
函数源码
function home_url( $path = '', $scheme = null ) {
return get_home_url( null, $path, $scheme );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

