Core Function
View Source on Trac ↗ wp_schedule_single_event()
wp_schedule_single_event( mixed $timestamp, mixed $hook, mixed $args = array(), mixed $wp_error = false ) Schedules an event to run only once.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $timestamp int | Unix timestamp (UTC) for when to next run the event. Required |
| $hook string | Action hook to execute when the event is run. Required |
| array | $args Optional. Array containing arguments to pass to the hook's callback function. Each value in the array is passed to the callback as an individual parameter. The array keys are ignored. Default empty array. Required |
| $wp_error bool | Optional. Whether to return a WP_Error on failure. Default false. |
Return Value
((bool)
| WP_Error) True if event successfully scheduled. False or WP_Error on failure.
Function Information
Since Version
2.1.0
Source File
wp-includes/cron.php
Advertisement