as_unschedule_action( string $hook, array $args = array(), string $group = '' )
Cancel the next occurrence of a scheduled action.
Description Description
While only the next instance of a recurring or cron action is unscheduled by this method, that will also prevent all future instances of that recurring or cron action from being run. Recurring and cron actions are scheduled in a sequence instead of all being scheduled at once. Each successive occurrence of a recurring action is scheduled only after the former action is run. If the next instance is never run, because it’s unscheduled by this function, then the following instance will never be scheduled (or exist), which is effectively the same as being unscheduled by this method also.
Parameters Parameters
- $hook
-
(Required) The hook that the job will trigger.
- $args
-
(Optional) Args that would have been passed to the job.
Default value: array()
- $group
-
(Optional) The group the job is assigned to.
Default value: ''
Return Return
(string|null) The scheduled action ID if a scheduled action was found, or null if no matching action found.
Source Source
File: packages/action-scheduler/functions.php