From cf397cfbdd1173da4ba193306c2543aa4098bead Mon Sep 17 00:00:00 2001 From: Claudiu Lodromanean Date: Mon, 13 Mar 2017 09:55:18 -0700 Subject: [PATCH] Dont try and save inputs that arent there --- .../admin/meta-boxes/class-wc-meta-box-order-data.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php index 1f8e9c2aa24..0ecc938e887 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php @@ -479,6 +479,10 @@ class WC_Meta_Box_Order_Data { $field['id'] = '_billing_' . $key; } + if ( ! isset( $_POST[ $field['id'] ] ) ) { + continue; + } + if ( is_callable( array( $order, 'set_billing_' . $key ) ) ) { $props[ 'billing_' . $key ] = wc_clean( $_POST[ $field['id'] ] ); } else { @@ -494,6 +498,10 @@ class WC_Meta_Box_Order_Data { $field['id'] = '_shipping_' . $key; } + if ( ! isset( $_POST[ $field['id'] ] ) ) { + continue; + } + if ( is_callable( array( $order, 'set_shipping_' . $key ) ) ) { $props[ 'shipping_' . $key ] = wc_clean( $_POST[ $field['id'] ] ); } else {