add_user_role WordPress Action Hook
This hook is used to add a user role to a WordPress site. It is called when a user is created or when their role is changed. It takes two arguments: the user ID and the role to add.
do_action( 'add_user_role', int $user_id , string $role ) #
Fires immediately after the user has been given a new role.
Parameters
- $user_id
(int)The user ID.
- $role
(string)The new role.
Source
Changelog
Version | Description |
---|---|
4.3.0 | Introduced. |