(hook_prefix)(address_type)_(prop)
Filter: 'woocommerce_customer_get_[billing|shipping]_[prop]'
Allow developers to change the returned value for any customer address property.
Usage
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(string)
- The address property value.
- $customer(WC_Customer)
- The customer object being read.
Changelog
| Since 3.6.0 | Introduced. |
Where the hook is called
(hook_prefix)(address_type)_(prop)
(hook_prefix)(address_type)_(prop)
woocommerce/includes/class-wc-customer.php 539
$value = apply_filters( $this->get_hook_prefix() . $address_type . '_' . $prop, $value, $this );
woocommerce/includes/class-wc-order.php 654
$value = apply_filters( $this->get_hook_prefix() . $address_type . '_' . $prop, $value, $this );