do_action( 'set_user_role', int $user_id, string $role, array $old_roles )

Fires after the user’s role has changed.


Parameters

$user_id

The user ID.

$role

The new role.

$old_roles

An array of the user's previous roles.


Source

File: wp-includes/class-wp-user.php

View on GitHub



Changelog

Changelog
Version Description
WP-3.6.0 Added $old_roles to include an array of the user's previous roles.
WP-2.9.0 Introduced.