woocommerce_blocks_product_grid_is_cacheable
Filters whether or not the product grid is cacheable.
Использование
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(массив)
- Query args for the products query passed to BlocksWpQuery.
Список изменений
С версии 2.5.0 | Введена. |
Где вызывается хук
woocommerce_blocks_product_grid_is_cacheable
woocommerce/src/Blocks/BlockTypes/AbstractProductGrid.php 354
$is_cacheable = (bool) apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', true, $this->query_args );