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.

Метод класса: WC_Order{}

Хуки из метода

Возвращает

Массив. The stored address after filter.

Использование

$WC_Order = new WC_Order();
$WC_Order->get_address( $address_type );
$address_type(строка)
Type of address; 'billing' or 'shipping'.
По умолчанию: 'billing'

Список изменений

С версии 2.4.0 Введена.

Код WC_Order::get_address() 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 );
}