Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_schedule_event

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
82       *
83       *     @type string       $hook      Action hook to execute when the event is run.
84       *     @type int          $timestamp Unix timestamp (UTC) for when to next run the event.
85       *     @type string|false $schedule  How often the event should subsequently recur.
86       *     @type array        $args      Array containing each separate argument to pass to the hook's callback function.
87       *     @type int          $interval  Optional. The interval time in seconds for the schedule. Only present for recurring events.
88       * }
89       * @param bool               $wp_error Whether to return a WP_Error on failure.
90       */
91      $pre = apply_filters( 'pre_schedule_event', null, $event, $wp_error );
92
93      if ( null !== $pre ) {
94           if ( $wp_error && false === $pre ) {
95                return new WP_Error(
96                     'pre_schedule_event_false',
97                     __( 'A plugin prevented the event from being scheduled.' )
98                );
99           }
100
 
Line Code
258      $event = (object) array(
259           'hook'      => $hook,
260           'timestamp' => $timestamp,
261           'schedule'  => $recurrence,
262           'args'      => $args,
263           'interval'  => $schedules[ $recurrence ]['interval'],
264      );
265
266      /** This filter is documented in wp-includes/cron.php */
267      $pre = apply_filters( 'pre_schedule_event', null, $event, $wp_error );
268
269      if ( null !== $pre ) {
270           if ( $wp_error && false === $pre ) {
271                return new WP_Error(
272                     'pre_schedule_event_false',
273                     __( 'A plugin prevented the event from being scheduled.' )
274                );
275           }
276