schedule_event
Modify an event before it is scheduled.
Usage
add_filter( 'schedule_event', 'wp_kama_schedule_event_filter' );
/**
* Function for `schedule_event` filter-hook.
*
* @param object|false $event An object containing an event's data, or boolean false to prevent the event from being scheduled.
*
* @return object|false
*/
function wp_kama_schedule_event_filter( $event ){
// filter...
return $event;
}
- $event(object|false)
An object containing an event's data, or boolean false to prevent the event from being scheduled.
-
hook(string)
Action hook to execute when the event is run. -
timestamp(int)
Unix timestamp (UTC) for when to next run the event. -
schedule(string|false)
How often the event should subsequently recur. -
args(array)
Array containing each separate argument to pass to the hook's callback function. - interval(int)
Optional. The interval time in seconds for the schedule. Only present for recurring events.
-
Changelog
| Since 3.1.0 | Introduced. |
Where the hook is called
schedule_event
schedule_event
wp-includes/cron.php 179
$event = apply_filters( 'schedule_event', $event );
wp-includes/cron.php 287
$event = apply_filters( 'schedule_event', $event );