WordPress教程-wordpress后台版本更新提示去除方法
后台去除wordpress版本更新提示和插件更新提示的正确方法,wordpress程序自带在程序版本检测功能,当你建网站时使用的WP程序不是较新版本时,WP程序会在网站后台出现如下图的版本更新提示。
1、去除后台 wordpress 版本更新提示,把如下代码 copy 到你主题的 functions.php,刷新后台,完美。
/** 移除 wordpress 版本更新提示 */add_filter( ‘pre_site_transient_update_core’, create_function( ‘$a’, “return null;” ) );
2、去除后台插件版本更新的提示,同样把如下代码 copy 到你主题的 functions.php,刷新后台
/** 移除 wordpress 插件更新提示 */remove_action( ‘load-update-core.php’, ‘wp_update_plugins’ );add_filter( ‘pre_site_transient_update_plugins’, create_function( ‘$b’, “return null;” ) );
添加以上代码后,WordPress就不会在自动检查更新和提示了。