Changeset 15746 for trunk/wp-admin/includes/ms.php
- Timestamp:
- 10/07/2010 07:34:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r15718 r15746 503 503 504 504 $blog = get_active_blog_for_user( get_current_user_id() ); 505 $dashboard_blog = get_dashboard_blog(); 505 506 506 if ( is_object( $blog ) ) { 507 507 wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case" 508 508 exit; 509 } 510 511 /* 512 If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog, 513 then update the primary_blog record to match the user's blog 514 */ 515 $blogs = get_blogs_of_user( get_current_user_id() ); 516 517 if ( !empty( $blogs ) ) { 518 foreach( $blogs as $blogid => $blog ) { 519 if ( $blogid != $dashboard_blog->blog_id && get_user_meta( get_current_user_id() , 'primary_blog', true ) == $dashboard_blog->blog_id ) { 520 update_user_meta( get_current_user_id(), 'primary_blog', $blogid ); 521 continue; 522 } 523 } 524 $blog = get_blog_details( get_user_meta( get_current_user_id(), 'primary_blog', true ) ); 525 wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); 526 exit; 527 } 509 } else { 510 wp_redirect( user_admin_url( '?c=' . $c ) ); // redirect and count to 5, "just in case" 511 } 512 528 513 wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); 529 514 }
Note: See TracChangeset
for help on using the changeset viewer.