woocommerce_restore_order_item_stock
Fires when stock restored to a specific line item
Использование
add_action( 'woocommerce_restore_order_item_stock', 'wp_kama_woocommerce_restore_order_item_stock_action', 10, 4 ); /** * Function for `woocommerce_restore_order_item_stock` action-hook. * * @param WC_Order_Item_Product $item Order item data. * @param int $new_stock New stock. * @param int $old_stock Old stock. * @param WC_Order $order Order data. * * @return void */ function wp_kama_woocommerce_restore_order_item_stock_action( $item, $new_stock, $old_stock, $order ){ // action... }
- $item(WC_Order_Item_Product)
- Order item data.
- $new_stock(int)
- New stock.
- $old_stock(int)
- Old stock.
- $order(WC_Order)
- Order data.
Список изменений
С версии 9.1.0 | Введена. |
Где вызывается хук
woocommerce_restore_order_item_stock
woocommerce/includes/wc-stock-functions.php 396
do_action( 'woocommerce_restore_order_item_stock', $item, $new_stock, $old_stock, $order );