Changeset 15452 for branches/3.0/wp-includes/ms-blogs.php
- Timestamp:
- 07/21/2010 08:10:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-includes/ms-blogs.php
r15168 r15452 372 372 373 373 function switch_to_blog( $new_blog, $validate = false ) { 374 global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $ current_user, $wp_object_cache;374 global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache; 375 375 376 376 if ( empty($new_blog) ) … … 407 407 $wpdb->suppress_errors( false ); 408 408 } 409 410 if ( is_object( $current_user ) ) 411 $current_user->for_blog( $blog_id ); 409 410 if ( did_action('init') ) { 411 $current_user = wp_get_current_user(); 412 if ( is_object( $current_user ) ) 413 $current_user->for_blog( $blog_id ); 414 } 412 415 413 416 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) … … 431 434 432 435 function restore_current_blog() { 433 global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $ current_user, $wp_object_cache;436 global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache; 434 437 435 438 if ( !$switched ) … … 461 464 } 462 465 463 if ( is_object( $current_user ) ) 464 $current_user->for_blog( $blog_id ); 466 if ( did_action('init') ) { 467 $current_user = wp_get_current_user(); 468 if ( is_object( $current_user ) ) 469 $current_user->for_blog( $blog_id ); 470 } 465 471 466 472 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) )
Note: See TracChangeset
for help on using the changeset viewer.