WordPress.org

Make WordPress Core

Changeset 15872


Ignore:
Timestamp:
10/20/10 16:50:57 (7 years ago)
Author:
ryan
Message:

Schedule update checks from an init hook. see #15148

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/update.php

    r15591 r15872  
    335335} 
    336336 
     337/** 
     338 * Schedule core, theme, and plugin update checks. 
     339 * 
     340 * @since 3.1.0 
     341 */ 
     342function wp_schedule_update_checks() { 
     343    if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') ) 
     344        wp_schedule_event(time(), 'twicedaily', 'wp_version_check'); 
     345 
     346    if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') ) 
     347        wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins'); 
     348 
     349    if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') ) 
     350        wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); 
     351} 
     352 
    337353if ( ! is_main_site() ) 
    338354    return; 
     
    353369add_action( 'wp_update_themes', 'wp_update_themes' ); 
    354370 
    355 if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') ) 
    356     wp_schedule_event(time(), 'twicedaily', 'wp_version_check'); 
    357  
    358 if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') ) 
    359     wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins'); 
    360  
    361 if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') ) 
    362     wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); 
     371add_action('init', 'wp_schedule_update_checks'); 
    363372 
    364373?> 
Note: See TracChangeset for help on using the changeset viewer.