Created
December 21, 2020 09:34
-
-
Save rohit-ghoghari/78d2bd6d3257ee7990410a7b3b4583d1 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
<?php | |
/** | |
* Hide admin bar for non-admins | |
*/ | |
function hide_admin_bar_callback( $show ) { | |
if ( ! current_user_can( 'administrator' ) ) { | |
return false; | |
} | |
return $show; | |
} | |
add_filter( 'show_admin_bar', 'hide_admin_bar_callback' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment