Last active
February 27, 2016 06:23
-
-
Save carlodaniele/1277236d434068a30311 to your computer and use it in GitHub Desktop.
Remove WordPress Toolbar for non-admin users
This file contains 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 | |
/** | |
* Remove WordPress Toolbar for subscribers | |
*/ | |
function myplugin_remove_admin_bar() { | |
if ( ! current_user_can( 'publish_posts' ) ) { | |
show_admin_bar( false ); | |
} | |
} | |
add_action( 'plugins_loaded', 'myplugin_remove_admin_bar' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment