删除WordPress仪表盘

2014年03月21日13:42:55 发表评论 已收录 2,907

如果想删除WordPress仪表盘,可以将下面的代码添加到您的当前主题的 functions.php 文件:

  1. function disable_dashboard_widgets() {
  2.     global $wp_meta_boxes;
  3.     // wp..
  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);
weinxin
我的微信
分享交流WordPress经验与技巧,关注前端设计与网站制作。仅用于功能演示。
Begin主题购买
Begin主题购买

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: