From 96695f28644043fa47cb6843e3a29a7959a00bd4 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Tue, 20 Mar 2018 23:06:57 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@42866 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/ms-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index cc797a7bd0..ebc699436d 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -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; }