From dbc9719d76ca75e61d9d3d8077cc9d21e971f205 Mon Sep 17 00:00:00 2001 From: Risto Niinemets Date: Tue, 4 Jun 2019 08:13:40 +0300 Subject: [PATCH] Use order raw address instead of formatted for filter --- includes/class-wc-order.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/class-wc-order.php b/includes/class-wc-order.php index 6319591ee68..932677cbe5c 100644 --- a/includes/class-wc-order.php +++ b/includes/class-wc-order.php @@ -882,14 +882,12 @@ class WC_Order extends WC_Abstract_Order { * @return string */ public function get_formatted_shipping_address( $empty_content = '' ) { - $address = ''; + $address = apply_filters( 'woocommerce_order_formatted_shipping_address', $this->get_address( 'shipping' ), $this ); if ( $this->has_shipping_address() ) { - $address = WC()->countries->get_formatted_address( $this->get_address( 'shipping' ) ); + $address = WC()->countries->get_formatted_address( $address ); } - $address = apply_filters( 'woocommerce_order_formatted_shipping_address', $address, $this ); - return $address ? $address : $empty_content; }