woocommerce_rest_api_cache_file_warning_suppression_ttl filter-hookWC 10.6.0

Filter the TTL for suppressing duplicate file tracking warnings.

By default, each unique warning (file path + reason) is logged only once per hour to avoid flooding the log. Use this filter to customize the suppression period. Return 0 to disable suppression and log all warnings.

Usage

add_filter( 'woocommerce_rest_api_cache_file_warning_suppression_ttl', 'wp_kama_woocommerce_rest_api_cache_file_warning_suppression_ttl_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_api_cache_file_warning_suppression_ttl` filter-hook.
 * 
 * @param int    $ttl       The suppression TTL in seconds.
 * @param string $file_path The file path that couldn't be tracked.
 * @param string $reason    The reason the file couldn't be tracked.
 *
 * @return int
 */
function wp_kama_woocommerce_rest_api_cache_file_warning_suppression_ttl_filter( $ttl, $file_path, $reason ){

	// filter...
	return $ttl;
}
$ttl(int)
The suppression TTL in seconds.
Default: HOUR_IN_SECONDS
$file_path(string)
The file path that couldn't be tracked.
$reason(string)
The reason the file couldn't be tracked.

Changelog

Since 10.6.0 Introduced.

Where the hook is called

In file: /src/Internal/Traits/RestApiCache.php
woocommerce_rest_api_cache_file_warning_suppression_ttl
woocommerce/src/Internal/Traits/RestApiCache.php 1276-1281
$suppression_ttl = apply_filters(
	'woocommerce_rest_api_cache_file_warning_suppression_ttl',
	self::$file_warning_suppression_ttl,
	$file_path,
	$reason
);

Where the hook is used in WooCommerce

Usage not found.