上述示例的逗号类型错误,可能是复制和粘贴造成的。这是正确的类型
//Disable Default Dashboard Widgets
function remove_dashboard_meta() {
remove_meta_box(\'dashboard_incoming_links\', \'dashboard\', \'normal\');
remove_meta_box(\'dashboard_plugins\', \'dashboard\', \'normal\');
remove_meta_box(\'dashboard_primary\', \'dashboard\', \'normal\');
remove_meta_box(\'dashboard_secondary\', \'dashboard\', \'normal\');
remove_meta_box(\'dashboard_quick_press\', \'dashboard\', \'side\');
remove_meta_box(\'dashboard_recent_drafts\', \'dashboard\', \'side\');
remove_meta_box(\'dashboard_recent_comments\', \'dashboard\', \'normal\');
remove_meta_box(\'dashboard_right_now\', \'dashboard\', \'normal\');
remove_meta_box(\'dashboard_activity\', \'dashboard\', \'normal\');
remove_meta_box(\'rg_forms_dashboard\', \'dashboard\', \'normal\');
remove_action(\'admin_notices\', \'update_nag\');
}
add_action(\'admin_init\', \'remove_dashboard_meta\');
第二个答案是,要删除Elementor及其概述,请使用以下代码:
remove_meta_box(\'e-dashboard-overview\', \'dashboard\', \'normal\');
Wordpress开发者提要小部件可以通过以下方式删除:
remove_meta_box(\'wpdev_feed_widget\', \'dashboard\', \'normal\');