JetEngine - User Profile Builder - 'Disable Admin Bar For Non-Admins' Blocks Admin Bar For Editor Role
Closed this issue · 2 comments
Describe the bug
If you enable this in the JetEngine User Profile settings screen:
Then the admin bar disappears for the Editor role.
I consider Editor to still be a site administrator role, based on the definition that they use the admin bar / and admin panel as part of their tasks.
Looking at the code, it seems the issue is because its checking for manage_options
:
So this means that if you're using this you have to choose between showing the admin bar to public users of the User Profile feature, or disable it for Editor role, woo Shop Manager role, and even Author / Contributor.
I think this needs some fine tuning, with a better UI, but in the short term, consider at least making it filterable for power users to customise?
@rtpHarry Admin (Administrator) and Editor is a different roles in WP. Anyway, if you need more precise control on this - you can do it manually from the code, without using this switcher. If we'll add an ability to change behavior of this switcher with some hooks, the result by difficulty of use will be the same as disabling admin bar programmatically with some code-snippet. For example like this - https://themeisle.com/blog/hide-wordpress-admin-bar/#hiding-for-user-role (section b) Using code)
I agree that the complexity is roughly the same, but the difference is that if it could be extended via a filter, a technical developer can put a proper fix in place, and then normal non-programmer admins on the site could still use the feature. As it stands, it sucked up a bunch of time diagnosing it, and will come up again in the future if anyone tries to use the button and can't figure out why its not making any difference.
I disagree with your take on the admins, yes it is technically a separate role, but I dont know anyone that would say the woocommerce shop manager role wasn't a site "admin". I don't see the usefulness of it being for "exactly administrator role" not "accounts that use the admin bar", and the wording isn't precise to make that clear, and the check isn't precise because it looks at manage_options
that may or may not be exclusive to "administrator role".
Anyway, I guess what you're really saying is "nobody else has complained and its not worth the dev resources".
I've implemented my own solution with code 👍