(hook_prefix)(address_type)_(prop)
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 | Введена. |
Где вызывается хук
(hook_prefix)(address_type)_(prop)
(hook_prefix)(address_type)_(prop)
woocommerce/includes/class-wc-customer.php 536
$value = apply_filters( $this->get_hook_prefix() . $address_type . '_' . $prop, $value, $this );
woocommerce/includes/class-wc-order.php 647
$value = apply_filters( $this->get_hook_prefix() . $address_type . '_' . $prop, $value, $this );