Created
June 6, 2021 14:22
-
-
Save manuelhudec/50e60798960ef1f32288ec6617a0c54e to your computer and use it in GitHub Desktop.
Disable WordPress Admin Bar for All Users Except Administrators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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