Ticket #25958: 25958.patch
File 25958.patch, 1023 bytes (added by , 10 years ago) |
---|
-
src/wp-includes/class-wp-xmlrpc-server.php
478 478 $blogs = (array) get_blogs_of_user( $user->ID ); 479 479 $struct = array(); 480 480 481 $primary_blog_id = 0; 482 $active_blog = get_active_blog_for_user( $user->ID ); 483 if ( $active_blog ) { 484 $primary_blog_id = (int) $active_blog->blog_id; 485 } 486 481 487 foreach ( $blogs as $blog ) { 482 488 // Don't include blogs that aren't hosted at this site 483 489 if ( $blog->site_id != get_current_site()->id ) … … 488 494 switch_to_blog( $blog_id ); 489 495 490 496 $is_admin = current_user_can( 'manage_options' ); 497 $is_primary = ( $blog_id == $primary_blog_id ); 491 498 492 499 $struct[] = array( 493 500 'isAdmin' => $is_admin, 501 'isPrimary' => $is_primary, 494 502 'url' => home_url( '/' ), 495 503 'blogid' => (string) $blog_id, 496 504 'blogName' => get_option( 'blogname' ),