概要
今天因需求构建一个wordpress网站,应要求屏蔽一些不需要的功能;随手做下笔记。 如图
实现功能
1.停用版本更新通知
2.停用插件更新通知
3.停用主题更新通知
4.删除后台顶级菜单,子菜单
5.删除仪表盘页面模块
6.移除后台左上角 WordPress Logo
7.解决停用版本、插件、主题更新通知后,后台打开慢问题
具体操作如下 编辑主题
DUX6.0: 模板函数 (functions.php)
<?php
// Require theme functions
require get_stylesheet_directory() . '/functions-theme.php';
// Customize your functions
//============删除通知版本其它=============
//停用版本更新通知:打开主题的functions.php文件,加入以下语法,这样即可关闭版本更新通知。
remove_action('load-update-core.php', 'wp_update_themes');
add_filter('pre_site_transient_update_themes', create_function('$a', "return null;"));
//停用插件更新通知:打开主题的functions.php文件,加入以下语法,就可以关闭插件更新通知的讯息了。
remove_action('load-update-core.php', 'wp_update_plugins');
add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;"));
//停用主题更新通知:打开主题的functions.php文件,将以下语法加入到主题内,储存并上传即可。
remove_action ('load-update-core.php', 'wp_update_themes');
add_filter('pre_site_transient_update_core', create_function('$a', "return null;"));
//上面代码配合下面代码使用可以解决后台打开慢的问题
// 彻底关闭自动更