首页 WP 免FTP和屏蔽更新的方法

WP 免FTP和屏蔽更新的方法

牛仔抄 2020-11-5 0 169

1,免FTP安装插件和主题:
在wp-config.php中加入以下代码:
/* 免FTP /
define("FS_METHOD", "direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);

2,屏蔽更新:
在相应主题的functions.php后面加入以下代码:
function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates'); //WordPress核心
add_filter('pre_site_transient_update_plugins','remove_core_updates'); //WordPress插件
add_filter('pre_site_transient_update_themes','remove_core_updates'); //WordPress主题

作者: 牛仔抄
牛仔抄

迷途小书童,热衷于电脑与网络技术,自学多年,一事无成。

发表评论: