*
* @since MU
*
- * @global wpdb $wpdb
+ * @global wpdb $wpdb WordPress database abstraction object.
*/
function wpmu_update_blogs_date() {
global $wpdb;
* @return string Full URL of the blog if found. Empty string if not.
*/
function get_blogaddress_by_id( $blog_id ) {
- $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
- return ( $bloginfo ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : '';
+ $bloginfo = get_blog_details( (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 );
}
/**
*
* @since MU
*
- * @global wpdb $wpdb
+ * @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $slug
* @return int A blog id
*
* @since MU
*
- * @global wpdb $wpdb
+ * @global wpdb $wpdb WordPress database abstraction object.
*
* @param int|string|array $fields Optional. A blog ID, a blog slug, or an array of fields to query against.
* If not specified the current blog ID is used.
}
switch_to_blog( $blog_id );
- $details->blogname = get_option( 'blogname' );
- $details->siteurl = get_option( 'siteurl' );
- $details->post_count = get_option( 'post_count' );
+ $details->blogname = get_option( 'blogname' );
+ $details->siteurl = get_option( 'siteurl' );
+ $details->post_count = get_option( 'post_count' );
+ $details->home = get_option( 'home' );
restore_current_blog();
/**
*
* @since MU
*
- * @global wpdb $wpdb
+ * @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $blog_id Blog ID
* @param array $details Array of details keyed by blogs table field names.
*
* @since MU
*
- * @global wpdb $wpdb
+ * @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $blog_id BLog ID
* @param string $pref A field name
*
* @since MU
*
- * @global wpdb $wpdb
+ * @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $id The blog id
* @param string $pref A field name
*
* @since MU
*
- * @global wpdb $wpdb
+ * @global wpdb $wpdb WordPress database abstraction object.
*
* @param mixed $deprecated Not used
* @param int $start The offset