get_blogaddress_by_id( int $blog_id )
Get a full blog URL, given a blog id.
描述
参数
- $blog_id
-
(int)
(Required)
Blog ID
返回值
(string) Full URL of the blog if found. Empty string if not.
源代码
File: wp-includes/ms-blogs.php
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 );
}
更新日志
Version | 描述 |
---|---|
MU | Introduced. |
相关函数
Uses
-
wp-includes/ms-blogs.php:
get_site() -
wp-includes/formatting.php:
esc_url()
Used By
-
wp-includes/ms-functions.php:
install_blog() -
wp-includes/ms-functions.php:
wpmu_welcome_notification()
你可能对这些文章感兴趣:
- wordpress函数get_the_posts_navigation()用法示例
- wordpress函数get_the_title()用法示例
- wordpress函数get_the_terms()用法示例
- wordpress函数get_the_tags()用法示例
- wordpress函数get_the_taxonomies()用法示例
- wordpress函数get_the_permalink()用法示例
- wordpress函数get_the_password_form()用法示例
- wordpress函数get_the_posts_pagination()用法示例
- wordpress函数get_the_modified_date()用法示例
- wordpress函数get_the_modified_time()用法示例
- wordpress函数get_the_modified_author()用法示例
- wordpress函数get_the_guid()用法示例
- wordpress函数get_the_ID()用法示例
- wordpress函数get_the_excerpt()用法示例
如有疑问,请前往问答中心反馈!
反馈