[wp-trac] [WordPress Trac] #20741: set_user_role action second argument not being passed

WordPress Trac wp-trac at lists.automattic.com
Thu May 24 00:47:40 UTC 2012


#20741: set_user_role action second argument not being passed
-----------------------------+-----------------------------
 Reporter:  hamidnazari      |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:  3.3.2
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 According to capabilities.php:608

 {{{
 do_action( 'set_user_role', $this->ID, $role );
 }}}

 But the output of this when you change user's role

 {{{
 function twentyeleven_set_user_role($user_id, $role) {
         global $wpdb;
         $all_args = func_get_args();
         print_r($all_args);
         exit;
 }
 add_action( 'set_user_role', 'twentyeleven_set_user_role');
 }}}

 is

 {{{
 Array
 (
     [0] => 2
 )
 }}}

 where 2 is the user id.

 '''Also:''' I wish I could receive both new and old roles in the action.
 Possible?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20741>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list