Make WordPress Core


Ignore:
Timestamp:
06/24/2010 03:01:29 PM (14 years ago)
Author:
ryan
Message:

Use get_current_user() and get_current_user_id() instead of global . Props filofo. see #13934 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-blogs.php

    r15168 r15315  
    372372
    373373function 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;
    375375
    376376    if ( empty($new_blog) )
     
    407407        $wpdb->suppress_errors( false );
    408408    }
    409 
     409 
     410    $current_user = wp_get_current_user();
    410411    if ( is_object( $current_user ) )
    411412        $current_user->for_blog( $blog_id );
     
    431432
    432433function restore_current_blog() {
    433     global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $current_user, $wp_object_cache;
     434    global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache;
    434435
    435436    if ( !$switched )
     
    461462    }
    462463
     464    $current_user = wp_get_current_user();
    463465    if ( is_object( $current_user ) )
    464466        $current_user->for_blog( $blog_id );
Note: See TracChangeset for help on using the changeset viewer.