woocommerce_blocks_product_grid_is_cacheable хук-фильтрWC 1.0

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.

Где вызывается хук

AbstractProductGrid::get_products()
woocommerce_blocks_product_grid_is_cacheable
woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractProductGrid.php 351
$is_cacheable      = (bool) apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', true, $this->query_args );

Где используется хук в WooCommerce

Использование не найдено.