ode' => $address->get_billing_postcode(), 'country' => $billing_country, 'email' => $address->get_billing_email(), 'phone' => $address->get_billing_phone(), ], $additional_address_fields ); // Add any missing keys from additional_fields_controller to the address response. foreach ( $this->additional_fields_controller->get_address_fields_keys() as $field ) { if ( isset( $address_object[ $field ] ) ) { continue; } $address_object[ $field ] = ''; } foreach ( $address_object as $key => $value ) { if ( isset( $this->get_properties()[ $key ]['type'] ) && 'boolean' === $this->get_properties()[ $key ]['type'] ) { $address_object[ $key ] = (bool) $value; } else { $address_object[ $key ] = $this->prepare_html_response( $value ); } } return $address_object; } throw new RouteException( 'invalid_object_type', sprintf( /* translators: Placeholders are class and method names */ __( '%1$s requires an instance of %2$s or %3$s for the address', 'woocommerce' ), 'BillingAddressSchema::get_item_response', 'WC_Customer', 'WC_Order' ), 500 ); } }