Changeset 13311 for trunk/wp-admin/includes/ms.php
- Timestamp:
- 02/22/2010 09:25:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r13301 r13311 544 544 if ( !empty( $blogs ) ) { 545 545 foreach( $blogs as $blogid => $blog ) { 546 if ( $blogid != $dashboard_blog->blog_id && get_user meta( $current_user->ID , 'primary_blog' ) == $dashboard_blog->blog_id ) {547 update_user meta( $current_user->ID, 'primary_blog', $blogid );546 if ( $blogid != $dashboard_blog->blog_id && get_user_meta( $current_user->ID , 'primary_blog' ) == $dashboard_blog->blog_id ) { 547 update_user_meta( $current_user->ID, 'primary_blog', $blogid ); 548 548 continue; 549 549 } 550 550 } 551 $blog = get_blog_details( get_user meta( $current_user->ID , 'primary_blog' ) );551 $blog = get_blog_details( get_user_meta( $current_user->ID , 'primary_blog' ) ); 552 552 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 553 553 wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case" … … 691 691 <?php 692 692 $all_blogs = get_blogs_of_user( $current_user->ID ); 693 $primary_blog = get_user meta($current_user->ID, 'primary_blog');693 $primary_blog = get_user_meta($current_user->ID, 'primary_blog'); 694 694 if ( count( $all_blogs ) > 1 ) { 695 695 $found = false; … … 705 705 if ( !$found ) { 706 706 $blog = array_shift( $all_blogs ); 707 update_user meta( $current_user->ID, 'primary_blog', $blog->userblog_id );707 update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id ); 708 708 } 709 709 } elseif ( count( $all_blogs ) == 1 ) { … … 711 711 echo $blog->domain; 712 712 if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list. 713 update_user meta( $current_user->ID, 'primary_blog', $blog->userblog_id );713 update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id ); 714 714 } else { 715 715 echo "N/A";
Note: See TracChangeset
for help on using the changeset viewer.