删除WordPress仪表盘

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

  1.  disable_dashboard_widgets() {
  2.      ;
  3.     
  4.     unset([\’dashboard\’][\’normal\’][\’core\’][\’dashboard_activity\’]);
  5.     unset([\’dashboard\’][\’normal\’][\’core\’][\’dashboard_right_now\’]);
  6.     unset([\’dashboard\’][\’normal\’][\’core\’][\’dashboard_recent_comments\’]);
  7.     unset([\’dashboard\’][\’normal\’][\’core\’][\’dashboard_incoming_links\’]);
  8.     unset([\’dashboard\’][\’normal\’][\’core\’][\’dashboard_plugins\’]);
  9.     unset([\’dashboard\’][\’side\’][\’core\’][\’dashboard_primary\’]);
  10.     unset([\’dashboard\’][\’side\’][\’core\’][\’dashboard_secondary\’]);
  11.     unset([\’dashboard\’][\’side\’][\’core\’][\’dashboard_quick_press\’]);
  12.     unset([\’dashboard\’][\’side\’][\’core\’][\’dashboard_recent_drafts\’]);
  13. }
  14. add_action(\’wp_dashboard_setup\’, \’disable_dashboard_widgets\’, 999);
    © 版权声明
    THE END
    喜欢就支持一下吧
    点赞0 分享
    评论 抢沙发

    请登录后发表评论

      暂无评论内容