Change WordPress user roles and capabilities › Forums › Bug Reports › Role back to the previous one after user log in › Reply To: Role back to the previous one after user log in
14/10/2019 at 11:54
#6012
Vladimir
Keymaster
Look at the code from Authorizer:
// Ensure user has the same role as their entry in the approved list.
if ( $user_info && ! in_array( $user_info['role'], $user->roles, true ) ) {
$user->set_role( $user_info['role'] );
}
Thus, if role granted to user is not found at Authorizer’s approved users list, plugin automatically changes it to some pre-approved role. I suppose you need to check some settings in Authorizer plugin.