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