Skip to content
Docs
Get RestroPress

Filter

rpress_tax_rate

Updated
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#

ParameterTypeDescription
$ratefloatTax rate as a decimal fraction.
$countrystring|falseCountry code, or false when not supplied.
$statestring|falseState 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), in rpress_get_tax_rate()

See also#

Was this page helpful?