woocommerce_layered_nav_count_maybe_cache

woocommerce_layered_nav_count_maybe_cache

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_layered_nav_count_maybe_cache') is found 1 times:

  • /src/Internal/ProductAttributesLookup/Filterer.php line 174
     
    		// We have a query - let's see if cached results of this query already exist.
    		$query_hash = md5( $query_sql );
    		// Maybe store a transient of the count values.
    		$cache = apply_filters( 'woocommerce_layered_nav_count_maybe_cache', true );
    		if ( true === $cache ) {
    			$cached_counts = (array) get_transient( 'wc_layered_nav_counts_' . sanitize_title( $taxonomy ) );
    		} else {
    			$cached_counts = array();
    		}
    		if ( ! isset( $cached_counts[ $query_hash ] ) ) {