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.9.8.1

apply_filters('woocommerce_layered_nav_count_maybe_cache') is found 2 times:

  • /includes/widgets/class-wc-widget-brand-nav.php line 513
    510
    511
    512
    513
    514
    515
    516
    517
    518
    // We have a query - let's see if cached results of this query already exist.
    $query_hash = md5( $query );
     
    $cache = apply_filters( 'woocommerce_layered_nav_count_maybe_cache', true ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
    if ( true === $cache ) {
        $cached_counts = (array) get_transient( 'wc_layered_nav_counts_' . sanitize_title( $taxonomy ) );
    } else {
        $cached_counts = array();
    }
  • /src/Internal/ProductAttributesLookup/Filterer.php line 184
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    // 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 ] ) ) {