Admin Bar or Top Bar is not hiding!
-
I am working on the final touches to get my site live. I was wondering why during testing as a user the Admin Bar was showing. I use a simple mu-plugin that looks like this:
function hide_admin_bar($show) { if (current_user_can('author') || current_user_can('subscriber') || current_user_can('prpro_role_1') || current_user_can('member') || current_user_can('contributor')) : return false; endif; return $show; } add_filter('show_admin_bar', 'hide_admin_bar');
Since that was not working I changed the code to this:
add_action('after_setup_theme', 'remove_admin_bar'); function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } }
Still not working so I went straight for the good ‘ole codex code:
if (!current_user_can('manage_options')) { show_admin_bar(false); }
Still no glory!!! I then installed a plugin called “Hide Admin Bars Base On User Roles” and that didn’t work either.
To quadruple check me I opened two other browsers to ensure that it had nothing to do with history or cache. Still, I have an Admin Bar, so I’m thinking there is something wrong with the latest version of WP v5.6.2.
Anyone else experiencing the same issue?
The page I need help with: [log in to see the link]
- The topic ‘Admin Bar or Top Bar is not hiding!’ is closed to new replies.