Multisite: Return WP_Site as expected in get_active_blog_for_user().

Previously it was possible for a standard object representing the site to be returned in some cases.

Fixes #38430.

Built from https://develop.svn.wordpress.org/trunk@42866


git-svn-id: http://core.svn.wordpress.org/trunk@42696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2018-03-20 23:07:30 +00:00
parent 61a0745df8
commit 89cb4caddc
2 changed files with 3 additions and 3 deletions

View File

@ -76,12 +76,12 @@ function get_active_blog_for_user( $user_id ) {
}
$details = get_site( $blog_id );
if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
$ret = $blog;
$ret = $details;
if ( get_user_meta( $user_id, 'primary_blog', true ) != $blog_id ) {
update_user_meta( $user_id, 'primary_blog', $blog_id );
}
if ( ! get_user_meta( $user_id, 'source_domain', true ) ) {
update_user_meta( $user_id, 'source_domain', $blog->domain );
update_user_meta( $user_id, 'source_domain', $details->domain );
}
break;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42864';
$wp_version = '5.0-alpha-42866';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.