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

Filters the HTML for products in the grid.

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

add_filter( 'woocommerce_blocks_product_grid_item_html', 'wp_kama_woocommerce_blocks_product_grid_item_html_filter', 10, 3 );

/**
 * Function for `woocommerce_blocks_product_grid_item_html` filter-hook.
 * 
 * @param string      $html    Product grid item HTML.
 * @param array       $data    Product data passed to the template.
 * @param \WC_Product $product Product object.
 *
 * @return string
 */
function wp_kama_woocommerce_blocks_product_grid_item_html_filter( $html, $data, $product ){

	// filter...
	return $html;
}
$html(строка)
Product grid item HTML.
$data(массив)
Product data passed to the template.
$product(\WC_Product)
Product object.

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

AbstractProductGrid::render_product()
woocommerce_blocks_product_grid_item_html
woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractProductGrid.php 507-521
return apply_filters(
	'woocommerce_blocks_product_grid_item_html',
	"<li class=\"wc-block-grid__product\">
		<a href=\"{$data->permalink}\" class=\"wc-block-grid__product-link\">
			{$data->image}
			{$data->title}
		</a>
		{$data->badge}
		{$data->price}
		{$data->rating}
		{$data->button}
	</li>",
	$data,
	$product
);

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

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