diff --git a/includes/class-wc-customer.php b/includes/class-wc-customer.php index 3c5c53079f3..d66efff9d2c 100644 --- a/includes/class-wc-customer.php +++ b/includes/class-wc-customer.php @@ -449,7 +449,19 @@ class WC_Customer extends WC_Legacy_Customer { * @return array */ public function get_billing( $context = 'view' ) { - return $this->get_prop( 'billing', $context ); + $value = null; + $prop = 'billing'; + + if ( array_key_exists( $prop, $this->data ) ) { + $changes = array_key_exists( $prop, $this->changes ) ? $this->changes[ $prop ] : array(); + $value = array_merge( $this->data[ $prop ], $changes ); + + if ( 'view' === $context ) { + $value = apply_filters( $this->get_hook_prefix() . $prop, $value, $this ); + } + } + + return $value; } /** @@ -580,7 +592,19 @@ class WC_Customer extends WC_Legacy_Customer { * @return array */ public function get_shipping( $context = 'view' ) { - return $this->get_prop( 'shipping', $context ); + $value = null; + $prop = 'shipping'; + + if ( array_key_exists( $prop, $this->data ) ) { + $changes = array_key_exists( $prop, $this->changes ) ? $this->changes[ $prop ] : array(); + $value = array_merge( $this->data[ $prop ], $changes ); + + if ( 'view' === $context ) { + $value = apply_filters( $this->get_hook_prefix() . $prop, $value, $this ); + } + } + + return $value; } /**