Make WordPress Core

Ticket #25475: cron.diff

File cron.diff, 4.1 KB (added by tmtoy, 12 years ago)
  • src/wp-includes/cron.php

     
    2727
    2828        $crons = _get_cron_array();
    2929        $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args );
    30         $event = apply_filters('schedule_event', $event);
     30        /**
     31         * Schedules a hook which will be executed by the WordPress actions core on a specific interval, specified by you.
     32         *
     33         * @since 3.1.0
     34         *
     35         * @param array $event {
     36         *   @type int    $timestamp  The first time that you want the event to occur.
     37         *   @type string $recurrence How often the event should reoccur.
     38         *   @type string $hook       The name of an action hook to execute.
     39         *   @type array  $args       Arguments to pass to the hook function(s).
     40         * }
     41         */
     42        $event = apply_filters( 'schedule_event', $event );
    3143
    3244        // A plugin disallowed this event
    3345        if ( ! $event )
     
    6880                return false;
    6981
    7082        $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
    71         $event = apply_filters('schedule_event', $event);
     83        // duplicate_hook
     84        $event = apply_filters( 'schedule_event', $event );
    7285
    7386        // A plugin disallowed this event
    7487        if ( ! $event )
     
    244257        $doing_wp_cron = sprintf( '%.22F', $gmt_time );
    245258        set_transient( 'doing_cron', $doing_wp_cron );
    246259
     260        $check_bool = TRUE;
     261        /**
     262         * SSL verify in Local WordPress Site.
     263         *
     264         * @since 2.8.0
     265         *
     266         * @type bool $check_bool Check to SecureSocketsLayer.
     267         */
     268        $args_apply_filters = apply_filters( 'https_local_ssl_verify', $check_bool );
     269        /**
     270         * Allows filtering of the URL, key and arguments passed to wp_remote_post() in spawn_cron().
     271         *
     272         * @since 3.5.0
     273         *
     274         * @type array{
     275         *    @type string url SiteURL/wp-crom.php?doing_wp_cron="22 digit gmt microtime".
     276         *    @type int    key 22 digit gmt microtime.
     277         *    @type array  args{
     278         *        @type int  timeout             Time to Timeout.
     279         *        @type bool blocking            Whether to blocking.
     280         *        @type bool $args_apply_filters Check to SecureSocketsLayer.
     281         *    }
     282         * }
     283         */
    247284        $cron_request = apply_filters( 'cron_request', array(
    248285                'url' => site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron ),
    249286                'key' => $doing_wp_cron,
    250                 'args' => array( 'timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters( 'https_local_ssl_verify', true ) )
     287                'args' => array( 'timeout' => 0.01, 'blocking' => false, 'sslverify' => $args_apply_filters )
    251288        ) );
    252289
    253290        wp_remote_post( $cron_request['url'], $cron_request['args'] );
     
    321358                'hourly'     => array( 'interval' => HOUR_IN_SECONDS,      'display' => __( 'Once Hourly' ) ),
    322359                'twicedaily' => array( 'interval' => 12 * HOUR_IN_SECONDS, 'display' => __( 'Twice Daily' ) ),
    323360                'daily'      => array( 'interval' => DAY_IN_SECONDS,       'display' => __( 'Once Daily' ) ),
    324         );
    325         return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
     361        );
     362        /**
     363         * A plugin to generate cron schedules in the wp_get_schedules function.
     364         *
     365         * @since 2.1.0
     366         *
     367         * @type array $schedules{
     368         *    @type array 'hourly'{
     369         *        @type int    'interval' The 'interval' is a number in seconds of when the cron job should run.
     370         *        @type string 'display'  The 'display' is the label name for this schedule.
     371         *    }
     372         *    @type array 'twicedaily'{
     373         *        @type int    'interval' The 'interval' is a number in seconds of when the cron job should run.
     374         *        @type string 'display'  The 'display' is the label name for this schedule.
     375         *    }
     376         *    @type array 'daily'{
     377         *        @type int    'interval' The 'interval' is a number in seconds of when the cron job should run.
     378         *        @type string 'display'  The 'display' is the label name for this schedule.
     379         *    }
     380         * }
     381         */
     382        $array_merge = array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
     383        return $array_merge;
    326384}
    327385
    328386/**