From 4df13e6ffbc1fbe1fc1c4d8e4daa566b337997a9 Mon Sep 17 00:00:00 2001 From: George Stephanis Date: Fri, 7 Aug 2015 17:06:50 -0400 Subject: [PATCH] Don't set them for unexistent rates. --- includes/admin/settings/views/html-settings-tax.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/admin/settings/views/html-settings-tax.php b/includes/admin/settings/views/html-settings-tax.php index b328fb935ff..49abe0aa01f 100644 --- a/includes/admin/settings/views/html-settings-tax.php +++ b/includes/admin/settings/views/html-settings-tax.php @@ -13,6 +13,11 @@ $rates = array_combine( wp_list_pluck( $rates, 'tax_rate_id' ), $rates ); // Drop the locations into the rates array. foreach ( $locations as $location ) { + // Don't set them for unexistent rates. + if ( ! isset( $rates[ $location->tax_rate_id ] ) ) { + continue; + } + // If the rate exists, initialize the array before appending to it. if ( ! isset( $rates[ $location->tax_rate_id ]->{$location->location_type} ) ) { $rates[ $location->tax_rate_id ]->{$location->location_type} = array(); }