WordPress at a glance
function is not described

wc_get_stock_html() WC 3.0.0

Get HTML to show product stock.

Return

String. Nothing.

Usage

wc_get_stock_html( $product );
$product(WC_Product) (required)
Product Object.

Changelog

Since 3.0.0 Introduced.

Code of wc_get_stock_html() WC 5.3.0

<?php
function wc_get_stock_html( $product ) {
	$html         = '';
	$availability = $product->get_availability();

	if ( ! empty( $availability['availability'] ) ) {
		ob_start();

		wc_get_template(
			'single-product/stock.php',
			array(
				'product'      => $product,
				'class'        => $availability['class'],
				'availability' => $availability['availability'],
			)
		);

		$html = ob_get_clean();
	}

	if ( has_filter( 'woocommerce_stock_html' ) ) {
		wc_deprecated_function( 'The woocommerce_stock_html filter', '', 'woocommerce_get_stock_html' );
		$html = apply_filters( 'woocommerce_stock_html', $html, $availability['availability'], $product );
	}

	return apply_filters( 'woocommerce_get_stock_html', $html, $product );
}