do_action( ‘set_user_role’, int $user_id, string $role, string[] $old_roles )

In this article

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

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

Changelog

VersionDescription
3.6.0Added $old_roles to include an array of the user’s previous roles.
2.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.