如果要从仪表板页面中删除元数据库,可以将其添加到函数中。php
function remove_dashboard_widgets () {
remove_meta_box(\'dashboard_quick_press\',\'dashboard\',\'side\'); //Quick Press widget
remove_meta_box(\'dashboard_recent_drafts\',\'dashboard\',\'side\'); //Recent Drafts
remove_meta_box(\'dashboard_primary\',\'dashboard\',\'side\'); //WordPress.com Blog
remove_meta_box(\'dashboard_secondary\',\'dashboard\',\'side\'); //Other WordPress News
remove_meta_box(\'dashboard_incoming_links\',\'dashboard\',\'normal\'); //Incoming Links
remove_meta_box(\'dashboard_plugins\',\'dashboard\',\'normal\'); //Plugins
remove_meta_box(\'dashboard_right_now\',\'dashboard\', \'normal\'); //Right Now
remove_meta_box(\'rg_forms_dashboard\',\'dashboard\',\'normal\'); //Gravity Forms
remove_meta_box(\'dashboard_recent_comments\',\'dashboard\',\'normal\'); //Recent Comments
remove_meta_box(\'icl_dashboard_widget\',\'dashboard\',\'normal\'); //Multi Language Plugin
remove_meta_box(\'dashboard_activity\',\'dashboard\', \'normal\'); //Activity
remove_action(\'welcome_panel\',\'wp_welcome_panel\');
}
add_action(\'wp_dashboard_setup\', \'remove_dashboard_widgets\');
只需注释掉你想保留的内容。传递的第一个值是元盒ID,因此您还可以删除插件添加的其他元盒。只需使用浏览器检查metabox并获取metabox ID即可。