Skip to content

Instantly share code, notes, and snippets.

/file1.php Secret

Created October 5, 2017 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e51ca6449690a02dbbc823f14ef53b48 to your computer and use it in GitHub Desktop.
Save anonymous/e51ca6449690a02dbbc823f14ef53b48 to your computer and use it in GitHub Desktop.
/*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