Don't do core version check from front page loads. Props Denis-de-Bernardy. fixes #8590

git-svn-id: https://develop.svn.wordpress.org/trunk@11209 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-05-05 21:51:48 +00:00
parent 015190e536
commit 8d664e4bae
1 changed files with 10 additions and 4 deletions

View File

@ -27,8 +27,11 @@ function wp_version_check() {
$php_version = phpversion(); $php_version = phpversion();
$current = get_transient( 'update_core' ); $current = get_transient( 'update_core' );
if ( ! is_object($current) ) if ( ! is_object($current) ) {
$current = new stdClass; $current = new stdClass;
$current->updates = array();
$current->version_checked = $wp_version;
}
$locale = apply_filters( 'core_version_check_locale', get_locale() ); $locale = apply_filters( 'core_version_check_locale', get_locale() );
@ -283,7 +286,8 @@ function _maybe_update_themes( ) {
wp_update_themes( ); wp_update_themes( );
} }
add_action( 'init', '_maybe_update_core' ); add_action( 'admin_init', '_maybe_update_core' );
add_action( 'wp_version_check', 'wp_version_check' );
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' );
@ -295,10 +299,12 @@ add_action( 'load-update.php', 'wp_update_themes' );
add_action( 'admin_init', '_maybe_update_themes' ); add_action( 'admin_init', '_maybe_update_themes' );
add_action( 'wp_update_themes', 'wp_update_themes' ); add_action( 'wp_update_themes', 'wp_update_themes' );
if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') )
wp_schedule_event(time(), 'twicedaily', 'wp_version_check');
if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') ) if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') )
wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins'); wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins');
if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') ) if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') )
wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');