woocommerce_version_string_generator_ttl filter-hookWC 10.4.0

Filter the TTL for version string cache.

Usage

add_filter( 'woocommerce_version_string_generator_ttl', 'wp_kama_woocommerce_version_string_generator_ttl_filter', 10, 2 );

/**
 * Function for `woocommerce_version_string_generator_ttl` filter-hook.
 * 
 * @param int    $ttl Time to live in seconds.
 * @param string $id  The ID.
 *
 * @return int
 */
function wp_kama_woocommerce_version_string_generator_ttl_filter( $ttl, $id ){

	// filter...
	return $ttl;
}
$ttl(int)
Time to live in seconds.
Default: 1 day
$id(string)
The ID.

Changelog

Since 10.4.0 Introduced.

Where the hook is called

VersionStringGenerator::store_version()
woocommerce_version_string_generator_ttl
woocommerce/src/Internal/Caches/VersionStringGenerator.php 136
$ttl = apply_filters( 'woocommerce_version_string_generator_ttl', DAY_IN_SECONDS, $id );

Where the hook is used in WooCommerce

Usage not found.