Automattic\WooCommerce\Internal\Logging

OrderLogsCleanupHelper::get_max_age_in_seconds │ private │ WC 1.0

Get the maximum age for debug logs before cleanup, in seconds. Returns 0 if cleanup is disabled via filter.

Метод класса: OrderLogsCleanupHelper{}

Возвращает

int.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_max_age_in_seconds(): int;

Код OrderLogsCleanupHelper::get_max_age_in_seconds() WC 11.2.2

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 ) );
}