woocommerce_updated_product_stock action-hookWC 3.6

Fire an action for this direct update so it can be detected by other code.

Usage

add_action( 'woocommerce_updated_product_stock', 'wp_kama_woocommerce_updated_product_stock_action' );

/**
 * Function for `woocommerce_updated_product_stock` action-hook.
 * 
 * @param int $product_id_with_stock Product ID that was updated directly.
 *
 * @return void
 */
function wp_kama_woocommerce_updated_product_stock_action( $product_id_with_stock ){

	// action...
}
$product_id_with_stock(int)
Product ID that was updated directly.

Changelog

Since 3.6 Introduced.

Where the hook is called

WC_Product_Data_Store_CPT::update_product_stock()
woocommerce_updated_product_stock
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 1638
do_action( 'woocommerce_updated_product_stock', $product_id_with_stock );

Where the hook is used in WooCommerce

Usage not found.