php 在Wordpress中禁用默认仪表板小组件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 在Wordpress中禁用默认仪表板小组件相关的知识,希望对你有一定的参考价值。

<?php
//---------------------------------------------------
// # disable default dashboard widgets
//---------------------------------------------------

// disable default dashboard widgets
function disable_default_dashboard_widgets() {

  // disable default dashboard widgets
  //remove_meta_box('dashboard_right_now', 'dashboard', 'core');
  remove_meta_box('dashboard_activity', 'dashboard', 'core');
  remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');
  remove_meta_box('dashboard_incoming_links', 'dashboard', 'core');
  remove_meta_box('dashboard_plugins', 'dashboard', 'core');

  remove_meta_box('dashboard_quick_press', 'dashboard', 'core');
  remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');
  remove_meta_box('dashboard_primary', 'dashboard', 'core');
  remove_meta_box('dashboard_secondary', 'dashboard', 'core');

  // disable iThemes Security dashboard widget
  remove_meta_box('itsec-dashboard-widget', 'dashboard', 'normal');
}
add_action('admin_menu', 'disable_default_dashboard_widgets');
?>


To disable plugin dashboard widgets get the id of the div that the widget is wrapped in and plug it in as in the example of the iThemes Security widget above

以上是关于php 在Wordpress中禁用默认仪表板小组件的主要内容,如果未能解决你的问题,请参考以下文章