隐藏WordPress后台的显示选项和帮助选项卡
发布时间:2015-10-15, 09:21:33 分类:PHP | 编辑 off 网址 | 辅助
正文 665字数 64,233阅读
隐藏显示选项在主题的functions.php中写如下代码
function remove_screen_options(){ return false;}
add_filter('screen_options_show_screen', 'remove_screen_options');
Run code
Cut to clipboard
对Editor(编辑)以下级别的用户隐藏显示选项
function remove_screen_options(){
if( !current_user_can('publish_pages') )
return false;
return true;
}
add_filter('screen_options_show_screen', 'remove_screen_options');
Run code
Cut to clipboard
隐藏帮助选项卡
在主题的functions.php中添加
add_filter( 'contextual_help', 'wpse50723_remove_help', 999, 3 );
function wpse50723_remove_help($old_help, $screen_id, $screen){
$screen->remove_help_tabs();
return $old_help;
}
Run code
Cut to clipboard
(支付宝)给作者钱财以资鼓励 (微信)→
暂无评论 »