On this page
do_action( 'set_user_role', int $user_id, string $role, string[] $old_roles )
Fires after the user’s role has changed.
Parameters
$user_idint-
The user ID.
$rolestring-
The new role.
$old_rolesstring[]-
An array of the user's previous roles.
Source
File: wp-includes/class-wp-user.php. View all references
do_action( 'set_user_role', $this->ID, $role, $old_roles );
Related
Used By
| Used By | Description |
|---|---|
| WP_User::set_role() wp-includes/class-wp-user.php | Sets the role of the user. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/set_user_role