Multisite: Replace `get_blog_details()` in `get_active_blog_for_user()` with `get_site()`.
Props flixos90. Fixes #38355. Built from https://develop.svn.wordpress.org/trunk@38914 git-svn-id: http://core.svn.wordpress.org/trunk@38857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4c0d82d653
commit
84f25462e1
|
@ -53,9 +53,9 @@ function get_active_blog_for_user( $user_id ) {
|
||||||
if ( false !== $primary_blog ) {
|
if ( false !== $primary_blog ) {
|
||||||
if ( ! isset( $blogs[ $primary_blog ] ) ) {
|
if ( ! isset( $blogs[ $primary_blog ] ) ) {
|
||||||
update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
|
update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
|
||||||
$primary = get_blog_details( $first_blog->userblog_id );
|
$primary = get_site( $first_blog->userblog_id );
|
||||||
} else {
|
} else {
|
||||||
$primary = get_blog_details( $primary_blog );
|
$primary = get_site( $primary_blog );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//TODO Review this call to add_user_to_blog too - to get here the user must have a role on this blog?
|
//TODO Review this call to add_user_to_blog too - to get here the user must have a role on this blog?
|
||||||
|
@ -71,7 +71,7 @@ function get_active_blog_for_user( $user_id ) {
|
||||||
foreach ( (array) $blogs as $blog_id => $blog ) {
|
foreach ( (array) $blogs as $blog_id => $blog ) {
|
||||||
if ( $blog->site_id != $wpdb->siteid )
|
if ( $blog->site_id != $wpdb->siteid )
|
||||||
continue;
|
continue;
|
||||||
$details = get_blog_details( $blog_id );
|
$details = get_site( $blog_id );
|
||||||
if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
|
if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
|
||||||
$ret = $blog;
|
$ret = $blog;
|
||||||
if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id )
|
if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id )
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38913';
|
$wp_version = '4.7-alpha-38914';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue