woocommerce_rest_set_order_item action-hookWC 4.5.0.

Allow extensions be notified before the item before is saved.

Usage

add_action( 'woocommerce_rest_set_order_item', 'wp_kama_woocommerce_rest_set_order_item_action', 10, 2 );

/**
 * Function for `woocommerce_rest_set_order_item` action-hook.
 * 
 * @param WC_Order_Item $item   The item object.
 * @param array         $posted The item data.
 *
 * @return void
 */
function wp_kama_woocommerce_rest_set_order_item_action( $item, $posted ){

	// action...
}
$item(WC_Order_Item)
The item object.
$posted(array)
The item data.

Changelog

Since 4.5.0. Introduced.

Where the hook is called

WC_REST_Orders_V2_Controller::set_item()
woocommerce_rest_set_order_item
WC_REST_Orders_V1_Controller::set_item()
woocommerce_rest_set_order_item
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php 1056
do_action( 'woocommerce_rest_set_order_item', $item, $posted );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-orders-v1-controller.php 795
do_action( 'woocommerce_rest_set_order_item', $item, $posted );

Where the hook is used in WooCommerce

Usage not found.