删除WordPress后台的仪表盘活动及新闻等模块

2022年4月6日09:37:48删除WordPress后台的仪表盘活动及新闻等模块已关闭评论

删除 WordPress 后台的仪表盘活动、快速草稿、概览和 WordPress 活动及新闻等模块,添加代码到当前主题的 functions.php 文件中:

function disable_dashboard_widgets() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); //活动
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);  //概况(Right Now)
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); //近期评论(Recent Comments)
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); //链入链接(Incoming Links)
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); //插件(Plugins)
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); //WordPress China 博客(WordPress )
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); //其它 WordPress 新闻(Other WordPress News)
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); //快速发布(QuickPress)
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); //近期草稿(Recent Drafts)
}
add_action('wp_dashboard_setup', 'disable_dashboard_widgets', 999);
本文地址:http://81uyu.com/uyu/1011.html 删除WordPress后台的仪表盘活动及新闻等模块
  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin