woocommerce_before_save_order_items хук-событиеWC 1.0

Allow other plugins to check change in order items before they are saved.

Использование

add_action( 'woocommerce_before_save_order_items', 'wp_kama_woocommerce_before_save_order_items_action', 10, 2 );

/**
 * Function for `woocommerce_before_save_order_items` action-hook.
 * 
 * @param  $order_id 
 * @param  $items    
 *
 * @return void
 */
function wp_kama_woocommerce_before_save_order_items_action( $order_id, $items ){

	// action...
}
$order_id
-
$items
-

Где вызывается хук

wc_save_order_items()
woocommerce_before_save_order_items
woocommerce/includes/admin/wc-admin-functions.php 290
do_action( 'woocommerce_before_save_order_items', $order_id, $items );

Где используется хук в WooCommerce

woocommerce/src/Internal/RestockRefundedItemsAdjuster.php 30
add_action( 'woocommerce_before_save_order_items', array( $this, 'initialize_restock_refunded_items' ), 10, 2 );