检查capability 您可以决定是否显示admin bar.
add_action( \'after_setup_theme\', \'remove_admin_bar\' );
function remove_admin_bar() {
if( ! current_user_can( \'administrator\' ) || ! current_user_can( \'editor\' ) || ! current_user_can( \'author\' ) ) {
show_admin_bar(false);
}
}