Created
February 8, 2018 13:05
-
-
Save cgi-caesar/1f38a13cc25755f9dd129baad31223d8 to your computer and use it in GitHub Desktop.
WordPress: remove admin bar for non admin users
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
<?php | |
add_action('after_setup_theme', function() { | |
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