Check for new version when visiting Tools->Upgrade. fixes #9108
git-svn-id: https://develop.svn.wordpress.org/trunk@10583 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
968a58a0c4
commit
283843ddb1
@ -203,6 +203,7 @@ function do_undismiss_core_update() {
|
|||||||
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
|
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
|
||||||
|
|
||||||
if ( 'upgrade-core' == $action ) {
|
if ( 'upgrade-core' == $action ) {
|
||||||
|
wp_version_check();
|
||||||
$title = __('Upgrade WordPress');
|
$title = __('Upgrade WordPress');
|
||||||
$parent_file = 'tools.php';
|
$parent_file = 'tools.php';
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
|
@ -31,12 +31,6 @@ function wp_version_check() {
|
|||||||
$current = new stdClass;
|
$current = new stdClass;
|
||||||
|
|
||||||
$locale = get_locale();
|
$locale = get_locale();
|
||||||
if (
|
|
||||||
isset( $current->last_checked ) &&
|
|
||||||
43200 > ( time() - $current->last_checked ) &&
|
|
||||||
$current->version_checked == $wp_version
|
|
||||||
)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Update last_checked for current to prevent multiple blocking requests if request hangs
|
// Update last_checked for current to prevent multiple blocking requests if request hangs
|
||||||
$current->last_checked = time();
|
$current->last_checked = time();
|
||||||
@ -86,7 +80,6 @@ function wp_version_check() {
|
|||||||
$updates->version_checked = $wp_version;
|
$updates->version_checked = $wp_version;
|
||||||
set_transient( 'update_core', $updates);
|
set_transient( 'update_core', $updates);
|
||||||
}
|
}
|
||||||
add_action( 'init', 'wp_version_check' );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check plugin versions against the latest versions hosted on WordPress.org.
|
* Check plugin versions against the latest versions hosted on WordPress.org.
|
||||||
@ -243,6 +236,18 @@ function wp_update_themes( ) {
|
|||||||
set_transient( 'update_themes', $new_option );
|
set_transient( 'update_themes', $new_option );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _maybe_update_core() {
|
||||||
|
global $wp_version;
|
||||||
|
|
||||||
|
$current = get_transient( 'update_core' );
|
||||||
|
|
||||||
|
if ( isset( $current->last_checked ) &&
|
||||||
|
43200 > ( time() - $current->last_checked ) &&
|
||||||
|
$current->version_checked == $wp_version )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wp_version_check();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Check the last time plugins were run before checking plugin versions.
|
* Check the last time plugins were run before checking plugin versions.
|
||||||
*
|
*
|
||||||
@ -277,6 +282,8 @@ function _maybe_update_themes( ) {
|
|||||||
wp_update_themes( );
|
wp_update_themes( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_action( 'init', '_maybe_update_core' );
|
||||||
|
|
||||||
add_action( 'load-plugins.php', 'wp_update_plugins' );
|
add_action( 'load-plugins.php', 'wp_update_plugins' );
|
||||||
add_action( 'load-update.php', 'wp_update_plugins' );
|
add_action( 'load-update.php', 'wp_update_plugins' );
|
||||||
add_action( 'admin_init', '_maybe_update_plugins' );
|
add_action( 'admin_init', '_maybe_update_plugins' );
|
||||||
|
Loading…
Reference in New Issue
Block a user