Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
get_home_url() - 检索前端可访问的给定站点的URL - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / get_home_url()

get_home_url( int|null $blog_id = null, string $path = '', string|null $scheme = null )

检索前端可访问的给定站点的URL


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "85076c7e64436300ca5d688cda971dc9" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "05a767e1e80b3fbcaa4313c042c82dd3" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

home

urlmore...


描述

返回具有适当协议的“home”选项。如果is_ssl()计算结果为true,则协议将为“https”;否则,它将与“home”选项相同。如果$scheme是“http”或“https”,则覆盖is_ssl()。


参数

$blog_id

(int|null)(可选) 站点ID。默认为null(当前站点)。

默认值: null

$path

(string)(可选) 相对于主页URL的路径。

默认值: ''

$scheme

(string|null)(可选) 给出主页URL上下文的方案。接受'http'、'https'、'relative'、'rest'或null。

默认值: null


返回

(string) 附加了可选路径的主页URL链接。


说明

基本用法

<?php echo get_home_url(); ?>

将输出:https://www.example.com,域和模式与您的设置匹配。



源码

查看源码 官方文档


更新日志

版本描述
3.0.0开始引入

Warning: Undefined variable $o in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference.php on line 194