WPDev.one
Core Function
View Source on Trac ↗

wp_unschedule_event()

wp_unschedule_event( mixed $timestamp, mixed $hook, mixed $args = array(), mixed $wp_error = false )

Unschedules a previously scheduled event.

Parameters 3 required

Name / Type Description
$timestamp
int

Unix timestamp (UTC) of the event.

Required
$hook
string

Action hook of the event.

Required
array

$args Optional. Array containing each separate argument to pass to the hook's callback function. Although not passed to a callback, these arguments are used to uniquely identify the event, so they should be the same as those used when originally scheduling the event. 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 unscheduled. False or WP_Error on failure.

Function Information

Since Version
2.1.0
Source File
wp-includes/cron.php
Advertisement