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
68       *     An object containing an event's data.
69       *
70       *     @type string       $hook      Action hook to execute when the event is run.
71       *     @type int          $timestamp Unix timestamp (UTC) for when to next run the event.
72       *     @type string|false $schedule  How often the event should subsequently recur.
73       *     @type array        $args      Array containing each separate argument to pass to the hook's callback function.
74       *     @type int          $interval  The interval time in seconds for the schedule. Only present for recurring events.
75       * }
76       */
77      $pre = apply_filters( 'pre_schedule_event', null, $event );
78      if ( null !== $pre ) {
79           return $pre;
80      }
81
82      // Don't schedule a duplicate if there's already an identical event due within 10 minutes of it
83      $next = wp_next_scheduled( $hook, $args );
84      if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) {
85           return false;
86      }
 
Line Code
163      $event = (object) array(
164           'hook'      => $hook,
165           'timestamp' => $timestamp,
166           'schedule'  => $recurrence,
167           'args'      => $args,
168           'interval'  => $schedules[ $recurrence ]['interval'],
169      );
170
171      /** This filter is documented in wp-includes/cron.php */
172      $pre = apply_filters( 'pre_schedule_event', null, $event );
173      if ( null !== $pre ) {
174           return $pre;
175      }
176
177      /** This filter is documented in wp-includes/cron.php */
178      $event = apply_filters( 'schedule_event', $event );
179
180      // A plugin disallowed this event
181      if ( ! $event ) {