WordPress.org

Make WordPress Core

Ticket #8590: 8590.2.diff

File 8590.2.diff, 1.4 KB (added by Denis-de-Bernardy, 9 years ago)
  • wp-includes/update.php

     
    2727        $php_version = phpversion();
    2828
    2929        $current = get_transient( 'update_core' );
    30         if ( ! is_object($current) )
     30        if ( ! is_object($current) ) {
    3131                $current = new stdClass;
     32                $current->updates = array();
     33                $current->version_checked = $wp_version;
     34        }
    3235
    3336        $locale = apply_filters( 'core_version_check_locale', get_locale() );
    3437
     
    283286        wp_update_themes( );
    284287}
    285288
    286 add_action( 'init', '_maybe_update_core' );
     289add_action( 'admin_init', '_maybe_update_core' );
     290add_action( 'wp_version_check', 'wp_version_check' );
    287291
    288292add_action( 'load-plugins.php', 'wp_update_plugins' );
    289293add_action( 'load-update.php', 'wp_update_plugins' );
     
    295299add_action( 'admin_init', '_maybe_update_themes' );
    296300add_action( 'wp_update_themes', 'wp_update_themes' );
    297301
     302if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') )
     303        wp_schedule_event(time(), 'twicedaily', 'wp_version_check');
     304
    298305if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') )
    299306        wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins');
    300307
    301 
    302308if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') )
    303309        wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
    304310
    305 ?>
     311?>
     312 No newline at end of file