Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Disable admin bar from all non admins and editors
// Disabled wordpress admin bar to all non admininstrators or editors - Jane James
function disable_admin_bar() {
if (current_user_can('administrator') || current_user_can('editor') ) {
// user can view admin bar
show_admin_bar(true); // this line isn't essentially needed by default...
} else {
// hide admin bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment