网上流行的移除“帮助”选项卡的代码如下:
//移除Wordpress后台“显示选项”和“帮助”选项卡
function remove_screen_options(){ return false;}
add_filter(‘screen_options_show_screen’, ‘remove_screen_options’);
add_filter( ‘contextual_help’, ‘wp_remove_help’, 999, 3 );
function wp_remove_help($old_help, $screen_id, $screen){
$screen->remove_help_tabs();
return $old_help;
但是上述代码在Wordpress 3.3 之后的版本会产生如下的告警:
Deprecated: contextual_help is deprecated since version 3.3.0!
在新版本的Wordpress中可以使用下面的代码实现同样的功能:
function remove_help_tab_func() {
get_current_screen()->remove_help_tabs();
}
add_action('current_screen', "remove_help_tab_func");
参考
Deprecated use of contextual_help | Wordpress.org
移除WordPress后台“显示选项”和“帮助”选项卡 - 博客主