action_scheduler_retention_period_for_failed
Set the retention period in seconds for actions with a failed status. If the action_scheduler_default_cleaner_statuses filter includes a failed status, this filter result will be ignored, and the retention period for failed actions will match that of other statuses.
Использование
add_filter( 'action_scheduler_retention_period_for_failed', 'wp_kama_action_scheduler_retention_period_for_failed_filter' );
/**
* Function for `action_scheduler_retention_period_for_failed` filter-hook.
*
* @param int $retention_period Retention period in seconds.
*
* @return int
*/
function wp_kama_action_scheduler_retention_period_for_failed_filter( $retention_period ){
// filter...
return $retention_period;
}
- $retention_period(int)
- Retention period in seconds.
Где вызывается хук
action_scheduler_retention_period_for_failed
woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueCleaner.php 121
$lifespan_failed = apply_filters( 'action_scheduler_retention_period_for_failed', 3 * $this->month_in_seconds );