函数原型
get_home_url( int|null $blog_id = null, string $path = ”, string|null $scheme = null ): string
函数描述
Retrieves the URL for a given site where the front end is accessible.
是否弃用
未弃用
函数参数
-
$blog_id
int|null
Optional - Site ID. Default null (current site).
Default:
null -
$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.
函数源码
<?php echo get_home_url(); ?>源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

