Make WordPress Core

Ticket #42758: ajami.42758.diff

File ajami.42758.diff, 1.2 KB (added by dd32, 8 years ago)

cron.php in diff form

  • src/wp-includes/cron.php

    function wp_cron() { 
    389389
    390390        if ( false === $crons = _get_cron_array() )
    391391                return;
    392392
    393393        $gmt_time = microtime( true );
    394394        $keys = array_keys( $crons );
    395395        if ( isset($keys[0]) && $keys[0] > $gmt_time )
    396396                return;
    397397
    398398        $schedules = wp_get_schedules();
    399399        foreach ( $crons as $timestamp => $cronhooks ) {
    400400                if ( $timestamp > $gmt_time ) break;
    401401                foreach ( (array) $cronhooks as $hook => $args ) {
    402402                        if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) )
    403403                                continue;
     404                        apply_action( $hook, $args );
    404405                        spawn_cron( $gmt_time );
    405406                        break 2;
    406407                }
    407408        }
    408409}
    409410
    410411/**
    411412 * Retrieve supported event recurrence schedules.
    412413 *
    413414 * The default supported recurrences are 'hourly', 'twicedaily', and 'daily'. A plugin may
    414415 * add more by hooking into the {@see 'cron_schedules'} filter. The filter accepts an array
    415416 * of arrays. The outer array has a key that is the name of the schedule or for
    416417 * example 'weekly'. The value is an array with two keys, one is 'interval' and
    417418 * the other is 'display'.
    418419 *