You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added intervention('remove-toolbar-frontend', 'all-not-admin'); and it removes the toolbar when a user has a role other than admin (excellent!) even when that user ALSO has an admin role (boo!).
It's an edge case so I'm flagging it up for interest really.
The following snippet works for admins who also have other roles
/* *
*
* Remove admin bar for all users except admin
*/
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
The text was updated successfully, but these errors were encountered:
I have added
intervention('remove-toolbar-frontend', 'all-not-admin');
and it removes the toolbar when a user has a role other than admin (excellent!) even when that user ALSO has an admin role (boo!).It's an edge case so I'm flagging it up for interest really.
The following snippet works for admins who also have other roles
The text was updated successfully, but these errors were encountered: