woocommerce_customer_taxable_address filter-hookWC 3.0.0

Filters the taxable address for a given customer.

Usage

add_filter( 'woocommerce_customer_taxable_address', 'wp_kama_woocommerce_customer_taxable_address_filter', 10, 2 );

/**
 * Function for `woocommerce_customer_taxable_address` filter-hook.
 * 
 * @param array  $taxable_address An array of country, state, postcode, and city for the customer's taxable address.
 * @param object $customer        The customer object for which the taxable address is being requested.
 *
 * @return array
 */
function wp_kama_woocommerce_customer_taxable_address_filter( $taxable_address, $customer ){

	// filter...
	return $taxable_address;
}
$taxable_address(array)
An array of country, state, postcode, and city for the customer's taxable address.
$customer(object)
The customer object for which the taxable address is being requested.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

WC_Customer::get_taxable_address()
woocommerce_customer_taxable_address
woocommerce/includes/class-wc-customer.php 220
return apply_filters( 'woocommerce_customer_taxable_address', array( $country, $state, $postcode, $city ), $this );

Where the hook is used in WooCommerce

woocommerce/src/Blocks/Shipping/ShippingController.php 72
add_filter( 'woocommerce_customer_taxable_address', array( $this, 'filter_taxable_address' ) );