remove_user_role
Fires immediately after a role as been removed from a user.
Usage
add_action( 'remove_user_role', 'wp_kama_remove_user_role_action', 10, 2 ); /** * Function for `remove_user_role` action-hook. * * @param int $user_id The user ID. * @param string $role The removed role. * * @return void */ function wp_kama_remove_user_role_action( $user_id, $role ){ // action... }
- $user_id(int)
- The user ID.
- $role(string)
- The removed role.
Changelog
Since 4.3.0 | Introduced. |
Where the hook is called
remove_user_role
wp-includes/class-wp-user.php 595
do_action( 'remove_user_role', $this->ID, $role );
wp-includes/class-wp-user.php 637
do_action( 'remove_user_role', $this->ID, $old_role );
Where the hook is used in WordPress
wp-includes/default-filters.php 124
add_action( 'remove_user_role', 'wp_cache_set_users_last_changed' );