woocommerce_cleanup_order_debug_logs_max_age хук-фильтрWC 10.7.0

Filter the retention period for place-order debug logs cleanup. Return 0 to disable cleanup entirely.

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

add_filter( 'woocommerce_cleanup_order_debug_logs_max_age', 'wp_kama_woocommerce_cleanup_order_debug_logs_max_age_filter' );

/**
 * Function for `woocommerce_cleanup_order_debug_logs_max_age` filter-hook.
 * 
 * @param int $max_age_in_seconds The maximum age in seconds before cleanup.
 *
 * @return int
 */
function wp_kama_woocommerce_cleanup_order_debug_logs_max_age_filter( $max_age_in_seconds ){

	// filter...
	return $max_age_in_seconds;
}
$max_age_in_seconds(int)
The maximum age in seconds before cleanup.
По умолчанию: 3 days

Список изменений

С версии 10.7.0 Введена.

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

OrderLogsCleanupHelper::get_max_age_in_seconds()
woocommerce_cleanup_order_debug_logs_max_age
woocommerce/src/Internal/Logging/OrderLogsCleanupHelper.php 84
return absint( apply_filters( 'woocommerce_cleanup_order_debug_logs_max_age', 3 * DAY_IN_SECONDS ) );

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

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