-
-
Save anonymous/e51ca6449690a02dbbc823f14ef53b48 to your computer and use it in GitHub Desktop.
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
/*Hide admin bar for certain roles*/ | |
function hide_admin_bar() { | |
if(is_user_logged_in() ) { | |
$current_user = wp_get_current_user(); | |
if ( in_array( ‘subscriber’, (array) $current_user->roles ) ) { | |
add_filter(‘show_admin_bar’, ‘__return_false’); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment