ActionScheduler_Store::cancel_actions_by_hook
Cancel pending actions by hook.
Method of the class: ActionScheduler_Store{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ActionScheduler_Store = new ActionScheduler_Store(); $ActionScheduler_Store->cancel_actions_by_hook( $hook );
- $hook(string) (required)
- Hook name.
Changelog
| Since 3.0.0 | Introduced. |
ActionScheduler_Store::cancel_actions_by_hook() ActionScheduler Store::cancel actions by hook code WC 10.4.3
public function cancel_actions_by_hook( $hook ) {
$action_ids = true;
while ( ! empty( $action_ids ) ) {
$action_ids = $this->query_actions(
array(
'hook' => $hook,
'status' => self::STATUS_PENDING,
'per_page' => 1000,
'orderby' => 'none',
)
);
$this->bulk_cancel_actions( $action_ids );
}
}