action_scheduler_failed_execution хук-событиеWC 1.0

Runs when action execution fails.

Использование

add_action( 'action_scheduler_failed_execution', 'wp_kama_action_scheduler_failed_execution_action', 10, 3 );

/**
 * Function for `action_scheduler_failed_execution` action-hook.
 * 
 * @param int       $action_id Action ID.
 * @param Exception $e         Exception instance.
 * @param string    $context   Execution context.
 *
 * @return void
 */
function wp_kama_action_scheduler_failed_execution_action( $action_id, $e, $context ){

	// action...
}
$action_id(int)
Action ID.
$e(Exception)
Exception instance.
$context(строка)
Execution context.

Где вызывается хук

ActionScheduler_Abstract_QueueRunner::handle_action_error()
action_scheduler_failed_execution
woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php 128
do_action( 'action_scheduler_failed_execution', $action_id, $e, $context );

Где используется хук в WooCommerce

woocommerce/packages/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php 23
add_action( 'action_scheduler_failed_execution', array( $this, 'untrack_action' ), 0, 0 );
woocommerce/packages/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php 33
remove_action( 'action_scheduler_failed_execution', array( $this, 'untrack_action' ), 0 );
woocommerce/packages/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php 81
add_action( 'action_scheduler_failed_execution', array( $this, 'action_failed' ), 10, 2 );
woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Logger.php 53
add_action( 'action_scheduler_failed_execution', array( $this, 'log_failed_action' ), 10, 3 );