WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
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 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 |
265 | $event = (object) array( |
266 | 'hook' => $hook, |
267 | 'timestamp' => $timestamp, |
268 | 'schedule' => $recurrence, |
269 | 'args' => $args, |
270 | 'interval' => $schedules[ $recurrence ]['interval'], |
271 | ); |
272 |
|
273 | /** This filter is documented in wp-includes/cron.php */ |
274 | $pre = apply_filters( 'pre_schedule_event', null, $event, $wp_error ); |
275 |
|
276 | if ( null !== $pre ) { |
277 | if ( $wp_error && false === $pre ) { |
278 | return new WP_Error( |
279 | 'pre_schedule_event_false', |
280 | __( 'A plugin prevented the event from being scheduled.' ) |
281 | ); |
282 | } |
283 |
|