network_home_url()
network_home_url( string $path = ”, string $scheme = null )
检索当前网络的主URL。
Retrieves the home URL for the current network.
说明(Description)
返回具有适当协议的主URL,’https’为’u ssl(),否则为’http’。如果$scheme是’http’或’https’,is_ssl()将被重写。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$path | (string) | 可选 | 相对于主URL的路径。 |
$scheme | (string) | 可选 | 提供主URL上下文的方案。接受“http”、“https”或“relative”。 |
返回(Return)
(string)附加了可选路径的主URL链接。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.0.0 | wp-includes/link-template.php:3492 | 6 | 8 |
笔记(Notes)
基本示例
network_home_url() 为WP2原创文章,链接:https://www.wp2.cn/functions/network_home_url/