From 3194c24c840ee000e396f23e03c33de5d553130d Mon Sep 17 00:00:00 2001 From: Slobodan Manic Date: Tue, 7 Jun 2016 08:13:35 +0200 Subject: [PATCH] Introduce woocommerce_before_save_order_items hook --- includes/admin/wc-admin-functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/admin/wc-admin-functions.php b/includes/admin/wc-admin-functions.php index 2fad4e8ccb5..968254b9175 100644 --- a/includes/admin/wc-admin-functions.php +++ b/includes/admin/wc-admin-functions.php @@ -179,6 +179,9 @@ function woocommerce_settings_get_option( $option_name, $default = '' ) { * @param array $items Order items to save */ function wc_save_order_items( $order_id, $items ) { + // Allow other plugins to check change in order items before they are saved + do_action( 'woocommerce_before_save_order_items', $order_id, $items ); + global $wpdb; // Order items + fees @@ -374,6 +377,6 @@ function wc_save_order_items( $order_id, $items ) { // Update version after saving update_post_meta( $order_id, '_order_version', WC_VERSION ); - // inform other plugins that the items have been saved + // Inform other plugins that the items have been saved do_action( 'woocommerce_saved_order_items', $order_id, $items ); }