um_set_user_role

Hook type

Filter

Description

User role was changed

Parameters

$new_role

(string) New role

$user_id

(int) User ID

$user

(array) Userdata

Usage

<?php add_filter( 'um_set_user_role', 'function_name', 10, 1 ); ?>

Examples

<?php
add_filter( 'um_set_user_role', 'my_set_user_role', 10, 1 );
function my_set_user_role( $new_role ) {
    // your code here
return $new_role;
}
?>

Change Log

Since: 2.0

Source

um_set_user_role is located in includes/core/class-roles-capabilities.php::line 253