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
This commit is contained in:
parent
ff9b91d141
commit
83925773d0
|
@ -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,10 +299,12 @@ 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');
|
||||
|
||||
|
|
Loading…
Reference in New Issue