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 |
---|---|
35 | $crons = _get_cron_array(); |
36 | $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args ); |
37 | /** |
38 | * Filter a single event before it is scheduled. |
39 | * |
40 | * @since 3.1.0 |
41 | * |
42 | * @param object $event An object containing an event's data. |
43 | */ |
44 | $event = apply_filters( 'schedule_event', $event ); |
45 |
|
46 | // A plugin disallowed this event |
47 | if ( ! $event ) |
48 | return false; |
49 |
|
50 | $key = md5(serialize($event->args)); |
51 |
|
52 | $crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args ); |
53 | uksort( $crons, "strnatcasecmp" ); |
Line | Code |
82 |
|
83 | $crons = _get_cron_array(); |
84 | $schedules = wp_get_schedules(); |
85 |
|
86 | if ( !isset( $schedules[$recurrence] ) ) |
87 | return false; |
88 |
|
89 | $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] ); |
90 | /** This filter is documented in wp-includes/cron.php */ |
91 | $event = apply_filters( 'schedule_event', $event ); |
92 |
|
93 | // A plugin disallowed this event |
94 | if ( ! $event ) |
95 | return false; |
96 |
|
97 | $key = md5(serialize($event->args)); |
98 |
|
99 | $crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args, 'interval' => $event->interval ); |
100 | uksort( $crons, "strnatcasecmp" ); |