woocommerce_empty_cogs_html filter-hookWC 9.8.0

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

Usage

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(string)
The rendered HTML.
$product(WC_Product)
The product for which the cost is rendered.

Changelog

Since 9.8.0 Introduced.

Where the hook is called

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 );

Where the hook is used in WooCommerce

Usage not found.