Change WordPress user roles and capabilities › Forums › How to or FAQ › How to restrict top bar › Reply To: How to restrict top bar
12/04/2015 at 08:06
#1449
boardlife
Participant
Hi again
Thanks for your reply. I tried this for contributors and wrote the code like this:
add_action(‘wp_head’, my_hide_admin_menu_bar);
function my_hide_admin_menu_bar() {
if (current_user_can(‘contributor’)) {
show_admin_bar(false);
}
}
It won’t work. Did I get the code right?