From 83925773d085cac9d6b8821309b5ba67a0b6d76e Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 5 May 2009 21:51:48 +0000 Subject: [PATCH] Don't do core version check from front page loads. Props Denis-de-Bernardy. fixes #8590 git-svn-id: http://svn.automattic.com/wordpress/trunk@11209 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/update.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-includes/update.php b/wp-includes/update.php index 92682a56a9..aba4f80a0f 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -27,8 +27,11 @@ function wp_version_check() { $php_version = phpversion(); $current = get_transient( 'update_core' ); - if ( ! is_object($current) ) + if ( ! is_object($current) ) { $current = new stdClass; + $current->updates = array(); + $current->version_checked = $wp_version; + } $locale = apply_filters( 'core_version_check_locale', get_locale() ); @@ -283,7 +286,8 @@ function _maybe_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-update.php', 'wp_update_plugins' ); @@ -295,11 +299,13 @@ add_action( 'load-update.php', 'wp_update_themes' ); add_action( 'admin_init', '_maybe_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') ) wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins'); - if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') ) wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); -?> +?> \ No newline at end of file