woocommerce_empty_cogs_html хук-фильтрWC 9.8.0

Filter to customize how an empty Cost of Goods Sold value for a product gets rendered to HTML.

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

add_filter( 'woocommerce_empty_cogs_html', 'wp_kama_woocommerce_empty_cogs_html_filter', 10, 2 );

/**
 * Function for `woocommerce_empty_cogs_html` filter-hook.
 * 
 * @param string     $html    The rendered HTML.
 * @param WC_Product $product The product for which the cost is rendered.
 *
 * @return string
 */
function wp_kama_woocommerce_empty_cogs_html_filter( $html, $product ){

	// filter...
	return $html;
}
$html(строка)
The rendered HTML.
$product(WC_Product)
The product for which the cost is rendered.

Список изменений

С версии 9.8.0 Введена.

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

WC_Product::get_cogs_value_html()
woocommerce_empty_cogs_html
woocommerce/includes/abstracts/abstract-wc-product.php 1967
$html = apply_filters( 'woocommerce_empty_cogs_html', '', $this );

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

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