From 6d891e1247edec2b16960ee756a4a8f68f90428d Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Wed, 15 Jun 2016 16:22:57 -0600 Subject: [PATCH] Handle case where no locations are sent in update request. --- .../api/class-wc-rest-shipping-zone-locations-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/class-wc-rest-shipping-zone-locations-controller.php b/includes/api/class-wc-rest-shipping-zone-locations-controller.php index c32ca281242..8cd35fc1422 100644 --- a/includes/api/class-wc-rest-shipping-zone-locations-controller.php +++ b/includes/api/class-wc-rest-shipping-zone-locations-controller.php @@ -83,7 +83,7 @@ class WC_REST_Shipping_Zone_Locations_Controller extends WC_REST_Shipping_Zones_ $raw_locations = $request->get_json_params(); $locations = array(); - foreach ( $raw_locations as $raw_location ) { + foreach ( (array) $raw_locations as $raw_location ) { if ( empty( $raw_location['code'] ) || empty( $raw_location['type'] ) ) { continue; }