How to assign user a role if none is present when logging in
I believe the reason it is overriding all users is how you are evaluating the user role (and when you are doing it). You’re running your check of the user role in mb_current_user_role() and that function assumes the user is logged in, otherwise it sets $user (initially) to null. But when that function is run … Read more