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

Fires after the user’s role has changed.


Description Description


Parameters Parameters

$user_id

(int) The user ID.

$role

(string) The new role.

$old_roles

(string[]) An array of the user's previous roles.


Top ↑

Source Source

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

View on Trac


Top ↑

Changelog Changelog

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


Top ↑

User Contributed Notes User Contributed Notes

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