show/hide admin bar for certain role
-
I already have this code that is in my functions to hide the toolbar from any logged in user other than admins, but when I created a new user role and gave it admin capability, the toolbar still remains hidden when logged in as that user. What can I adjust in my functions code to include the user titled ‘testuser’ as also able to see the admin toolbar?
add_action(‘after_setup_theme’, ‘remove_admin_bar’);
function remove_admin_bar() {
if (!current_user_can(‘administrator’) && !is_admin()) {
show_admin_bar(false);
}
}
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘show/hide admin bar for certain role’ is closed to new replies.