How are you changing the user’s role? Authorizer has code to synchronize roles between WordPress and its list, but if you’re changing the user’s role programmatically it may not fire.
https://github.com/uhm-coe/authorizer/blob/master/authorizer.php#L3230-L3274
Hi Paul,
I’m talking about changing a user role in the user edit screen in admin (the native way).
Thanks
That code block I linked to is the one that should update the user’s role in the Authorizer Approved List whenever you change it on the Edit User screen in WordPress.
Can you provide some more details on your configuration? I haven’t been able to reproduce your problem.
Hi Paul,
I’m using WordPress multisite, it might be the reason why you can’t reproduce I don’t know.
To reproduce it :
– Enable Authorizer in the network and set it up globally as well with a default role as subscriber
– On a specific site, sign-in with a user
– It’ll create a user with the subscriber role
– With a super admin, edit the user on the specific site and promote it to editor
– Sign-in again with authorizer with the previous user
– It’ll be unpromoted as subscriber
Does it make sense?
Thanks
Thanks for the steps! If I can reproduce the bug I will work on a fix (hopefully this week or next).
Nope, cannot reproduce, sorry. I followed your steps, and the user I promoted to Editor from Subscriber stayed as an Editor after signing in again.
Please try using a vanilla WordPress install to see if you can trigger what you are seeing. It’s possible there is a hook in your theme or in another plugin that’s interfering with the user roles.
Hi Paul,
Thanks your time, I’ll have a look next week and I’ll let you know if I have more info.
Hi Paul,
My mistake, the problem was due to a third party plugin (Members) which allows to give several roles to users. Deactivating this plugin solved my problem.
Thank you for your time and for this helpful plugin.
Best,
Ben