Merge pull request #13571 from woocommerce/fix-13529
Check $_POST before trying to save order address inputs
This commit is contained in:
commit
c80fed52d8
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue