(hook_prefix)(address_type)_(prop) хук-фильтрWC 3.6.0

Filter: 'woocommerce_customer_get_[billing|shipping]_[prop]'

Allow developers to change the returned value for any customer address property.

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

add_filter( '(hook_prefix)(address_type)_(prop)', 'wp_kama_hook_prefixaddress_type_prop_filter', 10, 2 );

/**
 * Function for `(hook_prefix)(address_type)_(prop)` filter-hook.
 * 
 * @param string      $value    The address property value.
 * @param WC_Customer $customer The customer object being read.
 *
 * @return string
 */
function wp_kama_hook_prefixaddress_type_prop_filter( $value, $customer ){

	// filter...
	return $value;
}
$value(строка)
The address property value.
$customer(WC_Customer)
The customer object being read.

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

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

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

WC_Customer::get_address_prop()
(hook_prefix)(address_type)_(prop)
WC_Order::get_address_prop()
(hook_prefix)(address_type)_(prop)
woocommerce/includes/class-wc-customer.php 477
$value = apply_filters( $this->get_hook_prefix() . $address_type . '_' . $prop, $value, $this );
woocommerce/includes/class-wc-order.php 629
$value = apply_filters( $this->get_hook_prefix() . $address_type . '_' . $prop, $value, $this );

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

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