woocommerce_blocks_product_grid_is_cacheable
Filters whether or not the product grid is cacheable.
Usage
add_filter( 'woocommerce_blocks_product_grid_is_cacheable', 'wp_kama_woocommerce_blocks_product_grid_is_cacheable_filter', 10, 2 );
/**
* Function for `woocommerce_blocks_product_grid_is_cacheable` filter-hook.
*
* @param boolean $is_cacheable The list of script dependencies.
* @param array $query_args Query args for the products query passed to BlocksWpQuery.
*
* @return boolean
*/
function wp_kama_woocommerce_blocks_product_grid_is_cacheable_filter( $is_cacheable, $query_args ){
// filter...
return $is_cacheable;
}
- $is_cacheable(true|false)
- The list of script dependencies.
- $query_args(array)
- Query args for the products query passed to BlocksWpQuery.
Changelog
| Since 2.5.0 | Introduced. |
Where the hook is called
woocommerce_blocks_product_grid_is_cacheable
woocommerce/src/Blocks/BlockTypes/AbstractProductGrid.php 358
$is_cacheable = (bool) apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', true, $this->query_args );