Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelhudec/50e60798960ef1f32288ec6617a0c54e to your computer and use it in GitHub Desktop.
Save manuelhudec/50e60798960ef1f32288ec6617a0c54e to your computer and use it in GitHub Desktop.
Disable WordPress Admin Bar for All Users Except Administrators
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment