Automattic\WooCommerce\Internal\Logging
OrderLogsCleanupHelper::get_max_age_in_seconds
Get the maximum age for debug logs before cleanup, in seconds. Returns 0 if cleanup is disabled via filter.
Method of the class: OrderLogsCleanupHelper{}
Hooks from the method
Returns
Int.
Usage
// private - for code of main (parent) class only $result = $this->get_max_age_in_seconds(): int;
OrderLogsCleanupHelper::get_max_age_in_seconds() OrderLogsCleanupHelper::get max age in seconds code WC 10.8.1
private function get_max_age_in_seconds(): int {
/**
* Filter the retention period for place-order debug logs cleanup.
* Return 0 to disable cleanup entirely.
*
* @param int $max_age_in_seconds The maximum age in seconds before cleanup. Default 3 days.
*
* @since 10.7.0
*/
return absint( apply_filters( 'woocommerce_cleanup_order_debug_logs_max_age', 3 * DAY_IN_SECONDS ) );
}