get_blogaddress_by_id
函数
get_blogaddress_by_id ( $blog_id )
- 参数
-
-
(int)
$blog_id
Blog ID.- Required: 是
-
(int)
- 返回值
-
- (string) Full URL of the blog if found. Empty string if not.
- 定义位置
-
-
wp-includes/ms-blogs.php
, line 41
-
wp-includes/ms-blogs.php
- 引入
- –
- 弃用
- –
Get a full blog URL, given a blog ID.
function get_blogaddress_by_id( $blog_id ) {
$bloginfo = get_site( (int) $blog_id );
if ( empty( $bloginfo ) ) {
return '';
}
$scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );
$scheme = empty( $scheme ) ? 'http' : $scheme;
return esc_url( $scheme . '://' . $bloginfo->domain . $bloginfo->path );
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。