Last active
August 20, 2022 00:58
-
-
Save hayskytech/248d5570910f67c47a61693a8566ab14 to your computer and use it in GitHub Desktop.
WP Hide Admin Bar for 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 | |
function haysky_disable_admin_bar() { | |
if (current_user_can('administrator') ) { | |
show_admin_bar(true); | |
} else { | |
show_admin_bar(false); | |
} | |
} | |
add_action('after_setup_theme', 'haysky_disable_admin_bar'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment