下面是如何通过临时对WP代码进行一次小修正来完成的:
将zip文件上载到WP的根文件夹,与wp-config.php
还有朋友打开文件wp-admin\\includes\\update.php
.查找函数find_core_update
, 并将其更改为:
function find_core_update( $version, $locale ) {
$updates = get_core_updates();
return $updates[0];
}
查找函数
get_core_updates
, 并将其更改为:
function get_core_updates( $options = array() ) {
$new_zip = \'wordpress-4.3.1.zip\';
$new_version = \'4.3.1\';
return array((object)array(
\'response\' => \'upgrade\',
\'current\' => $new_version,
\'download\' => \'../\' . $new_zip,
\'packages\' => (object) array (
\'partial\' => null,
\'new_bundled\' => null,
\'no_content\' => null,
\'full\' => \'../\' . $new_zip,
),
\'version\' => $new_version,
\'locale\' => null
));
}
设置
$new_zip
,
$new_version
根据需要提供变量。
进入管理面板并运行更新!