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