WordPress.org

Make WordPress Core

Changeset 42866


Ignore:
Timestamp:
03/20/2018 11:06:57 PM (2 months ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r42858 r42866  
    7777                $details = get_site( $blog_id );
    7878                if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
    79                     $ret = $blog;
     79                    $ret = $details;
    8080                    if ( get_user_meta( $user_id, 'primary_blog', true ) != $blog_id ) {
    8181                        update_user_meta( $user_id, 'primary_blog', $blog_id );
    8282                    }
    8383                    if ( ! get_user_meta( $user_id, 'source_domain', true ) ) {
    84                         update_user_meta( $user_id, 'source_domain', $blog->domain );
     84                        update_user_meta( $user_id, 'source_domain', $details->domain );
    8585                    }
    8686                    break;
Note: See TracChangeset for help on using the changeset viewer.