Definition:
function wp_unschedule_event( $timestamp, $hook, $args = array() {}
Unschedule a previously scheduled cron job.
The $timestamp and $hook parameters are required, so that the event can be identified.
Parameters
- int $timestamp: Timestamp for when to run the event.
- string $hook: Action hook, the execution of which will be unscheduled.
- array $args: Arguments to pass to the hook’s callback function. Although not passed to a callback function, these arguments are used to uniquely identify the scheduled event, so they should be the same as those used when originally scheduling the event.
Source code
function wp_unschedule_event( $timestamp, $hook, $args = array() ) { $crons = _get_cron_array(); $key = md5(serialize($args)); unset( $crons[$timestamp][$hook][$key] ); if ( empty($crons[$timestamp][$hook]) ) unset( $crons[$timestamp][$hook] ); if ( empty($crons[$timestamp]) ) unset( $crons[$timestamp] ); _set_cron_array( $crons ); }
4201
No comments yet... Be the first to leave a reply!