woocommerce_stock_amount filter-hookWC 1.0

Formats a stock amount by running it through a filter.

Usage

add_filter( 'woocommerce_stock_amount', 'wp_kama_woocommerce_stock_amount_filter' );

/**
 * Function for `woocommerce_stock_amount` filter-hook.
 * 
 * @param int|float $amount Stock amount.
 *
 * @return int|float
 */
function wp_kama_woocommerce_stock_amount_filter( $amount ){

	// filter...
	return $amount;
}
$amount(int|float)
Stock amount.

Where the hook is called

wc_stock_amount()
woocommerce_stock_amount
woocommerce/includes/wc-formatting-functions.php 481
return apply_filters( 'woocommerce_stock_amount', $amount );

Where the hook is used in WooCommerce

woocommerce/includes/wc-core-functions.php 42
add_filter( 'woocommerce_stock_amount', 'intval' ); // Stock amounts are integers by default.