Changing user role
-
I am working on changing user role based on some condition. It is just like, validating custom field in user registration form and assign new role to them. It is working fine only when using die(); at end of the function, if not, it is not working.
Please refer below code,
global $ultimatemember;
um_fetch_user( $user_id );
// new_role_slug is the slug of the new role e.g. member
$ultimatemember->user->set_role( ‘prime-member’ );It working fine only when adding die(); at end of the function.
The topic ‘Changing user role’ is closed to new replies.