From 1695f38f3133944b3c1e5316a9e2d91a6a574f13 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Mon, 19 Feb 2018 10:00:44 +0000 Subject: [PATCH] REST API: Add Country field to Business Address onboarding step --- .../core-api/class.jetpack-core-api-module-endpoints.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php b/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php index edad8ee5bde54..e04f308eba5ac 100644 --- a/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php +++ b/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php @@ -1187,8 +1187,9 @@ static function handle_business_address( $address ) { $city = isset( $address['city'] ) ? sanitize_text_field( $address['city'] ) : ''; $state = isset( $address['state'] ) ? sanitize_text_field( $address['state'] ) : ''; $zip = isset( $address['zip'] ) ? sanitize_text_field( $address['zip'] ) : ''; + $country = isset( $address['country'] ) ? sanitize_text_field( $address['country'] ) : ''; - $full_address = implode( ' ', array_filter( array( $street, $city, $state, $zip ) ) ); + $full_address = implode( ' ', array_filter( array( $street, $city, $state, $zip, $country ) ) ); $widget_options = array( 'title' => $title, @@ -1214,7 +1215,8 @@ static function handle_business_address( $address ) { 'street' => $street, 'city' => $city, 'state' => $state, - 'zip' => $zip + 'zip' => $zip, + 'country' => $country ); update_option( 'jpo_business_address', $address_save ); return true;