Change WordPress user roles and capabilities › Forums › How to or FAQ › How to restrict top bar › Reply To: How to restrict top bar
10/04/2015 at 17:56
#1447
Vladimir
Keymaster
Hi,
add to the active theme’s functions.php file this code:
add_action('wp_head', my_hide_admin_menu_bar);
function my_hide_admin_menu_bar() {
if (current_user_can('role_for_which_you_block_admin_bar')) {
show_admin_bar(false);
}
}