WordPress.org

Make WordPress Core

Ticket #14668: 14668.2.diff

File 14668.2.diff, 1.3 KB (added by scribu, 4 years ago)

check wp_next_scheduled()

  • wp-includes/update.php

     
    352352add_action( 'admin_init', '_maybe_update_themes' ); 
    353353add_action( 'wp_update_themes', 'wp_update_themes' ); 
    354354 
    355 if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') ) 
     355if ( !defined('WP_INSTALLING') ) { 
    356356        wp_schedule_event(time(), 'twicedaily', 'wp_version_check'); 
    357  
    358 if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') ) 
    359357        wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins'); 
    360  
    361 if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') ) 
    362358        wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); 
     359} 
    363360 
    364361?> 
  • wp-includes/cron.php

     
    5151 * @return bool|null False on failure, null when complete with scheduling event. 
    5252 */ 
    5353function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) { 
     54        if ( wp_next_scheduled( $hook ) ) 
     55                return false; 
     56 
    5457        $crons = _get_cron_array(); 
    5558        $schedules = wp_get_schedules(); 
    5659        $key = md5(serialize($args));