Uses
Uses | Description |
---|---|
wp-includes/ms-site.php: get_site() | Retrieves site data given a site ID or site object. |
wp-includes/formatting.php: esc_url() | Checks and cleans a URL. |
Get a full blog URL, given a 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 | Description |
---|---|
MU (3.0.0) | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_blogaddress_by_id