WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about set_user_role

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-includes/class-wp-user.php do_action 651 /**
* Fires after the user's role has changed.
*
* @since 2.9.0
* @since 3.6.0 Added $old_roles to include an array of the user's previous roles.
*
* @param int $user_id The user ID.
* @param string $role The new role.
* @param string[] $old_roles An array of the user's previous roles.
*/

Hook Parameters

Parameter Type Name Description
int $user_id The user ID.
string $role The new role.
string[] $old_roles An array of the user's previous roles.