action_scheduler_failed_(context)_action_deletion
Notify 3rd party code of exceptions when deleting a completed action older than the retention period
This hook provides a way for 3rd party code to log or otherwise handle exceptions relating to their actions.
Использование
add_action( 'action_scheduler_failed_(context)_action_deletion', 'wp_kama_action_scheduler_failed_context_deletion_action', 10, 4 ); /** * Function for `action_scheduler_failed_(context)_action_deletion` action-hook. * * @param int $action_id The scheduled actions ID in the data store * @param Exception $e The exception thrown when attempting to delete the action from the data store * @param int $lifespan The retention period, in seconds, for old actions * @param int $count_of_actions_to_delete The number of old actions being deleted in this batch * * @return void */ function wp_kama_action_scheduler_failed_context_deletion_action( $action_id, $e, $lifespan, $count_of_actions_to_delete ){ // action... }
- $action_id(int)
- The scheduled actions ID in the data store
- $e(Exception)
- The exception thrown when attempting to delete the action from the data store
- $lifespan(int)
- The retention period, in seconds, for old actions
- $count_of_actions_to_delete(int)
- The number of old actions being deleted in this batch
Список изменений
С версии 2.0.0 | Введена. |
Где вызывается хук
action_scheduler_failed_(context)_action_deletion
woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueCleaner.php 143
do_action( "action_scheduler_failed_{$context}_action_deletion", $action_id, $e, $lifespan, count( $actions_to_delete ) );