WordPress移除仪表盘多余模块

作者 : newwordpress 本文共994个字,预计阅读时间需要3分钟 发布时间: 2019-11-21 共535人阅读

在后台我们不免发现有很多模块默认是开启的,导致有的人可能会觉得太杂乱。

/*WordPress移除仪表盘多余模块*/
function example_remove_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
}
add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );
remove_action('welcome_panel', 'wp_welcome_panel');
function remove_dashboard_meta() {
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
}
add_action( 'admin_init', 'remove_dashboard_meta' );
wordpress是一个优秀的CMS,你可以搭载各种个性化的网站
NewWordPress » WordPress移除仪表盘多余模块

常见问题FAQ

美化包支持最新版本吗?
最新美化支持永久更新!

发表评论