Make WordPress Core

Ticket #25475: 25475.diff

File 25475.diff, 2.9 KB (added by DrewAPicture, 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         * Filter a single event before it is scheduled.
     32         *
     33         * @since 3.1.0
     34         *
     35         * @param object $event An object containing an event's data.
     36         */
     37        $event = apply_filters( 'schedule_event', $event );
    3138
    3239        // A plugin disallowed this event
    3340        if ( ! $event )
     
    6875                return false;
    6976
    7077        $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
    71         $event = apply_filters('schedule_event', $event);
     78        /** This filter is documented in wp-includes/cron.php */
     79        $event = apply_filters( 'schedule_event', $event );
    7280
    7381        // A plugin disallowed this event
    7482        if ( ! $event )
     
    244252        $doing_wp_cron = sprintf( '%.22F', $gmt_time );
    245253        set_transient( 'doing_cron', $doing_wp_cron );
    246254
     255        /**
     256         * Filter the cron request arguments.
     257         *
     258         * @since 3.5.0
     259         *
     260         * @param array $cron_request_array {
     261         *     An array of cron request URL arguments.
     262         *
     263         *     @type string $url  The cron request URL.
     264         *     @type int    $key  The 22 digit GMT microtime.
     265         *     @type array  $args {
     266         *         An array of cron request arguments.
     267         *
     268         *         @type int  $timeout   The request timeout in seconds. Default .01 seconds.
     269         *         @type bool $blocking  Whether to set blocking for the request. Default false.
     270         *         @type bool $sslverify Whether to sslverify. Default true.
     271         *     }
     272         * }
     273         */
    247274        $cron_request = apply_filters( 'cron_request', array(
    248                 'url' => site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron ),
    249                 'key' => $doing_wp_cron,
    250                 'args' => array( 'timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters( 'https_local_ssl_verify', true ) )
     275                'url'  => add_query_arg( array( 'doing_wp_cron', $doing_wp_cron ), site_url( 'wp-cron.php' ) ),
     276                'key'  => $doing_wp_cron,
     277                'args' => array(
     278                        'timeout'   => 0.01,
     279                        'blocking'  => false,
     280                        /** This filter is documented in wp-includes/class-http.php */
     281                        'sslverify' => apply_filters( 'https_local_ssl_verify', true )
     282                )
    251283        ) );
    252284
    253285        wp_remote_post( $cron_request['url'], $cron_request['args'] );
     
    322354                'twicedaily' => array( 'interval' => 12 * HOUR_IN_SECONDS, 'display' => __( 'Twice Daily' ) ),
    323355                'daily'      => array( 'interval' => DAY_IN_SECONDS,       'display' => __( 'Once Daily' ) ),
    324356        );
     357        /**
     358         * Filter the non-default cron schedules.
     359         *
     360         * @since 2.1.0
     361         *
     362         * @param array $new_schedules An array of non-default cron schedules. Default empty.
     363         */
    325364        return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
    326365}
    327366