woocommerce_cleanup_order_debug_logs_max_age
Filter the retention period for place-order debug logs cleanup. Return 0 to disable cleanup entirely.
Usage
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.
Default: 3 days
Changelog
| Since 10.7.0 | Introduced. |
Where the hook is called
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 ) );