Created
June 3, 2017 17:12
-
-
Save netdesignr/fa54bedd5ae4ebee89dc5bba64db0f08 to your computer and use it in GitHub Desktop.
Remove admin toolbar for all users except for 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
// Remove admin toolbar for all users except for Administrators | |
function remove_admin_bar() { | |
if (!current_user_can('administrator') && !is_admin()) { | |
show_admin_bar(false); | |
} | |
} | |
add_action('after_setup_theme', 'remove_admin_bar'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment