function disable_admin_bar() {
if (current_user_can('administrator') || current_user_can('contributor') ) {
show_admin_bar(true);
} else {
// hide admin bar
show_admin_bar(false);
}
}
add_action('after_setup_theme', 'disable_admin_bar');
About Gabor Flamich
I'm a web developer and designer based in Budapest, Hungary. In recent years, I've documented hundreds of solutions I came across during development. This site is an archive for useful code snippets on WordPress, Genesis Framework and WooCommerce. If You have any questions related to WordPress development, get in touch!
Leave a Reply