WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/22/2010 05:27:28 PM (12 years ago)
Author:
ryan
Message:

Introduce WP_User::for_blog() and current_user_can_for_blog() to avoid calls to WP_User::_init_caps(). fixes #11781

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-edit.php

    r12774 r12796  
    223223        // get blog prefix
    224224        $blog_prefix = $wpdb->get_blog_prefix( $id );
     225
    225226        // user roles
    226227        if ( is_array( $_POST[ 'role' ] ) == true ) {
     
    231232                if ( ! $user )
    232233                    continue;
    233                 // Hack. Init user caps for given blog.
    234                 $user->_init_caps($blog_prefix . 'capabilities');
     234                $user->for_blog($id);
    235235                $user->set_role($role);
    236236            }
Note: See TracChangeset for help on using the changeset viewer.