WC_Order::get_address()publicWC 2.4.0

Returns the requested address in raw, non-formatted way. Note: Merges raw data with get_prop data so changes are returned too.

Method of the class: WC_Order{}

Hooks from the method

Return

Array. The stored address after filter.

Usage

$WC_Order = new WC_Order();
$WC_Order->get_address( $address_type );
$address_type(string)
Type of address; 'billing' or 'shipping'.
Default: 'billing'

Changelog

Since 2.4.0 Introduced.

WC_Order::get_address() code WC 8.7.0

public function get_address( $address_type = 'billing' ) {
	/**
	 * Filter: 'woocommerce_get_order_address'
	 *
	 * Allow developers to change the returned value for an order's billing or shipping address.
	 *
	 * @since 2.4.0
	 * @param array  $address_data The raw address data merged with the data from get_prop.
	 * @param string $address_type Type of address; 'billing' or 'shipping'.
	 */
	return apply_filters( 'woocommerce_get_order_address', array_merge( $this->data[ $address_type ], $this->get_prop( $address_type, 'view' ) ), $address_type, $this );
}