Ticket #21459: 21459.7.diff
File 21459.7.diff, 1.4 KB (added by , 12 years ago) |
---|
-
wp-includes/ms-blogs.php
476 476 $prev_blog_id = $GLOBALS['blog_id']; 477 477 $GLOBALS['blog_id'] = $new_blog; 478 478 479 if ( did_action( 'init' ) ) {480 $wp_roles->reinit();481 $current_user = wp_get_current_user();482 $current_user->for_blog( $new_blog );483 }484 485 479 if ( function_exists( 'wp_cache_switch_to_blog' ) ) { 486 480 wp_cache_switch_to_blog( $new_blog ); 487 481 } else { … … 503 497 } 504 498 } 505 499 500 if ( did_action( 'init' ) ) { 501 $wp_roles->reinit(); 502 $current_user = wp_get_current_user(); 503 $current_user->for_blog( $new_blog ); 504 } 505 506 506 do_action( 'switch_blog', $new_blog, $prev_blog_id ); 507 507 $GLOBALS['switched'] = true; 508 508 … … 537 537 $GLOBALS['blog_id'] = $blog; 538 538 $GLOBALS['table_prefix'] = $wpdb->prefix; 539 539 540 if ( did_action( 'init' ) ) {541 $wp_roles->reinit();542 $current_user = wp_get_current_user();543 $current_user->for_blog( $blog );544 }545 546 540 if ( function_exists( 'wp_cache_switch_to_blog' ) ) { 547 541 wp_cache_switch_to_blog( $blog ); 548 542 } else { … … 564 558 } 565 559 } 566 560 561 if ( did_action( 'init' ) ) { 562 $wp_roles->reinit(); 563 $current_user = wp_get_current_user(); 564 $current_user->for_blog( $blog ); 565 } 566 567 567 do_action( 'switch_blog', $blog, $prev_blog_id ); 568 568 569 569 // If we still have items in the switched stack, consider ourselves still 'switched'