Created
October 10, 2014 10:25
-
-
Save thierrypigot/fad6e1d9fc2b0a37ce3e to your computer and use it in GitHub Desktop.
Hide adminbar to non admin
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 | |
/** | |
* Hide adminbar to non admin | |
**/ | |
add_action('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() | |
{ | |
if( ! current_user_can( 'manage_options' ) && !is_admin() && '/wp-admin/admin-ajax.php' != $_SERVER['PHP_SELF'] ) | |
{ | |
show_admin_bar(false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment