如何隐藏WordPress后台的显示选项和帮助选项卡

  • A+
所属分类:WordPress教程

wordpress后台屏幕右上角有两个小工具:显示选项(Screen Options)和帮助(Help),作为定制化Dashboard的一部分,某些时候需要将这两个小东西隐藏,隐藏的方法如下。

隐藏显示选项

在主题的functions.php中写如下代码

  1. function remove_screen_options(){ return false;}
  2. add_filter('screen_options_show_screen', 'remove_screen_options');

隐藏帮助选项卡
在主题的functions.php中添加

  1. add_filter( 'contextual_help', 'wpse50723_remove_help', 999, 3 );
  2. function wpse50723_remove_help($old_help$screen_id$screen){
  3.     $screen->remove_help_tabs();
  4.     return $old_help;
  5. }

发表评论

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