Core Function
View Source on Trac ↗ wp_clear_scheduled_hook()
wp_clear_scheduled_hook( mixed $hook, mixed $args = array(), mixed $wp_error = false ) Unschedules all events attached to the hook with the specified arguments.
Parameters 2 required
| Name / Type | Description |
|---|---|
| $hook string | Action hook, the execution of which will be unscheduled. 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
((int)
(int | false | WP_Error) On success an integer indicating number of events unscheduled (0 indicates no
events were registered with the hook and arguments combination), false or WP_Error
if unscheduling one or more events fail.
Function Information
Since Version
2.1.0
Source File
wp-includes/cron.php
Advertisement