woocommerce_version_string_invalidator_taxonomy_lookup_ttl

woocommerce_version_string_invalidator_taxonomy_lookup_ttl

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.10.5.2

apply_filters('woocommerce_version_string_invalidator_taxonomy_lookup_ttl') is found 2 times:

  • /src/Internal/Caches/ProductVersionStringInvalidator.php line 525
    			 *
    			 * @param int    $ttl         Cache TTL in seconds. Default 300 (5 minutes).
    			 * @param string $entity_type The type of entity being invalidated ('product').
    			 */
    			$ttl = apply_filters( 'woocommerce_version_string_invalidator_taxonomy_lookup_ttl', self::DEFAULT_TAXONOMY_LOOKUP_CACHE_TTL, 'product' );
    			wp_cache_set( $cache_key, $entity_ids, 'woocommerce', $ttl );
    		}
    
    		foreach ( $entity_ids as $entity_id ) {
    			$post_type = get_post_type( (int) $entity_id );
    			if ( 'product_variation' === $post_type ) {
    
  • /src/Internal/Caches/ProductVersionStringInvalidator.php line 579
    				'variation_ids' => $variation_ids,
    			);
    
    			// phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment -- Documented above.
    			$ttl = apply_filters( 'woocommerce_version_string_invalidator_taxonomy_lookup_ttl', self::DEFAULT_TAXONOMY_LOOKUP_CACHE_TTL, 'product' );
    			wp_cache_set( $cache_key, $cached, 'woocommerce', $ttl );
    		}
    
    		foreach ( $cached['product_ids'] as $product_id ) {
    			$this->invalidate( (int) $product_id );
    		}