当前位置:
首页 > 商城主题 > 如何删除WordPress后台的仪表盘模块

如何删除WordPress后台的仪表盘模块

               

如果想删除 WordPress 后台的仪表盘活动、快速草稿、概览和 WordPress 活动及新闻等模块,只需要将下面的代码添加到当前主题的 functions.php 文件中即可:

  1. //删除 WordPress 后台仪表盘
  2. function disable_dashboard_widgets() {
  3. global $wp_meta_boxes;
  4. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
  5. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  6. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  7. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  8. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  9. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  10. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
  11. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
  12. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
  13. }
  14. add_action('wp_dashboard_setup', 'disable_dashboard_widgets', 999);

如何删除WordPress后台的仪表盘模块:等您坐沙发呢!

发表评论

表情
还能输入210个字