add_user_role action-hook . WP 4.3.0
Fires immediately after the user has been given a new role.
Usage
add_action( 'add_user_role', 'action_function_name_7285', 10, 2 ); function action_function_name_7285( $user_id, $role ){ // action... }
- $user_id(int)
- The user ID.
- $role(string)
- The new role.
Changelog
Since 4.3.0 | Introduced. |
Where the hook is called
add_user_role
wp-includes/class-wp-user.php 554
do_action( 'add_user_role', $this->ID, $role );