Last active
January 10, 2017 21:52
-
-
Save Abd-Ur-Rehman/8667f5a374c87a5d16ff609c4f138dcc to your computer and use it in GitHub Desktop.
View full post at http://www.abdurrehman.net/blog
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
function bbloomer_hide_admin_bar_if_non_admin( $show ) { | |
if ( ! current_user_can( 'administrator' ) ) $show = false; | |
return $show; | |
} | |
add_filter( 'show_admin_bar', 'bbloomer_hide_admin_bar_if_non_admin', 20, 1 ); | |
// please note the priority = '20' to make sure we run the filter after Woo's one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment