Filter
rpress_tax_rate
On this page
Filters the tax rate used for calculations.
Runs in rpress_get_tax_rate() after the tax_rate setting is converted from a percentage to a decimal (8.5 becomes 0.085). Return a decimal fraction, not a percentage. Country and state are false when not supplied.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$rate | float | Tax rate as a decimal fraction. |
$country | string|false | Country code, or false when not supplied. |
$state | string|false | State code, or false when not supplied. |
Return value#
float. Tax rate as a decimal fraction.
Example#
function my_tax_rate_by_state( $rate, $country, $state ) {
if ( 'US' === $country && 'OR' === $state ) {
return 0.0;
}
return $rate;
}
add_filter( 'rpress_tax_rate', 'my_tax_rate_by_state', 10, 3 );
Source#
Applied in:
includes/tax-functions.php(line 51), inrpress_get_tax_rate()
See also#
Was this page helpful?
