function remove_admin_bar() {
if(!current_user_can('administrator') and !is_admin()){
show_admin_bar(false);
}
}
add_action('after_setup_theme', 'remove_admin_bar');
administrator
заменить на publish_posts
.function maybe_hide_admin_bar( $content ) {
if ( current_user_can( 'publish_posts' ) ) {
return $content;
}
return false;
}
add_filter( 'show_admin_bar' , 'maybe_hide_admin_bar' );