woocommerce_base_tax_rates

Get's an array of matching rates for the shop's base country.

Description

(array) apply_filters( 'woocommerce_base_tax_rates', (number) $self, (unknown) $tax_class ); 

Returns (array)

Parameters (2)

0. $self — Optional. (number) => self::find_rates( array( 'country' => WC()->countries->get_base_country(), 'state' => WC()->countries->get_base_state(), 'postcode' => WC()->countries->get_base_postcode(), 'city' => WC()->countries->get_base_city(), 'tax_class' => $tax_class, ) )
The self.
1. $tax_class (unknown)
The tax class.

Usage

To run the hook, copy the example below.
  1. $self = apply_filters( 'woocommerce_base_tax_rates', $self, $tax_class ); 
  2.  
  3. if ( !empty( $self ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_base_tax_rates callback 
  2. function filter_woocommerce_base_tax_rates( $self, $tax_class ) { 
  3. // make filter magic happen here... 
  4. return $self
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_base_tax_rates', 'filter_woocommerce_base_tax_rates', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_base_tax_rates', 'filter_woocommerce_base_tax_rates', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-wc-tax.php  
  1. return apply_filters( 'woocommerce_base_tax_rates', self::find_rates( array(