[wp-trac] [WordPress Trac] #18932: WP_User::set_role leaves user object without any caps when role does not change

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 13 20:29:54 UTC 2011


#18932: WP_User::set_role leaves user object without any caps when role does not
change
-----------------------------+------------------------------
 Reporter:  jammitch         |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Role/Capability  |     Version:  3.2.1
 Severity:  minor            |  Resolution:
 Keywords:  has-patch        |
-----------------------------+------------------------------
Changes (by scribu):

 * keywords:   => has-patch
 * component:  General => Role/Capability
 * severity:  normal => minor


Comment:

 Confirmed:

 {{{
 add_action( 'admin_notices', function() {
         $user = new WP_User( 2 ); // 2 being the id of a user with the
 'subscriber' role

         print_r($user->caps);

         $user->set_role( 'subscriber' );

         print_r($user->caps);
 });
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18932#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list