Created
July 12, 2015 20:19
-
-
Save webmasterninjay/06a2202ffdb71a0883c2 to your computer and use it in GitHub Desktop.
WordPress: Disable admin bar for non-admin user
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 | |
//* Disable admin bar for non-admin user | |
function themeblvd_disable_admin_bar() { | |
if( ! current_user_can('edit_posts') ) | |
add_filter('show_admin_bar', '__return_false'); | |
} | |
add_action( 'after_setup_theme', 'themeblvd_disable_admin_bar' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment