删除WordPress仪表盘

删除WordPress仪表盘-UI大牛

如果想删除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);

文章出自:https://zmingcx.com/

0

评论0

请先

没有账号? 注册  忘记密码?

社交账号快速登录