woocommerce_get_order_address хук-фильтрWC 2.4.0

Filter: woocommerce_get_order_address

Allow developers to change the returned value for an order's billing or shipping address.

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

add_filter( 'woocommerce_get_order_address', 'wp_kama_woocommerce_get_order_address_filter', 10, 3 );

/**
 * Function for `woocommerce_get_order_address` filter-hook.
 * 
 * @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'.
 * @param        $that         
 *
 * @return array
 */
function wp_kama_woocommerce_get_order_address_filter( $address_data, $address_type, $that ){

	// filter...
	return $address_data;
}
$address_data(массив)
The raw address data merged with the data from get_prop.
$address_type(строка)
Type of address; 'billing' or 'shipping'.
$that
-

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

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

Где вызывается хук

WC_Order::get_address()
woocommerce_get_order_address
woocommerce/includes/class-wc-order.php 937
return apply_filters( 'woocommerce_get_order_address', array_merge( $this->data[ $address_type ], $this->get_prop( $address_type, 'view' ) ), $address_type, $this );

Где используется хук в WooCommerce

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