Changeset 34574 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 09/26/2015 04:34:50 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r34573 r34574 544 544 * @return array|IXR_Error Array contains: 545 545 * - 'isAdmin' 546 * - 'isPrimary' - whether the blog is the user's primary blog 546 547 * - 'url' 547 548 * - 'blogid' … … 579 580 $blogs = (array) get_blogs_of_user( $user->ID ); 580 581 $struct = array(); 582 $primary_blog_id = 0; 583 $active_blog = get_active_blog_for_user( $user->ID ); 584 if ( $active_blog ) { 585 $primary_blog_id = (int) $active_blog->blog_id; 586 } 581 587 582 588 foreach ( $blogs as $blog ) { … … 590 596 591 597 $is_admin = current_user_can( 'manage_options' ); 598 $is_primary = ( (int) $blog_id === $primary_blog_id ); 592 599 593 600 $struct[] = array( 594 'isAdmin' => $is_admin, 595 'url' => home_url( '/' ), 596 'blogid' => (string) $blog_id, 597 'blogName' => get_option( 'blogname' ), 598 'xmlrpc' => site_url( 'xmlrpc.php', 'rpc' ), 601 'isAdmin' => $is_admin, 602 'isPrimary' => $is_primary, 603 'url' => home_url( '/' ), 604 'blogid' => (string) $blog_id, 605 'blogName' => get_option( 'blogname' ), 606 'xmlrpc' => site_url( 'xmlrpc.php', 'rpc' ), 599 607 ); 600 608
Note: See TracChangeset
for help on using the changeset viewer.