Skip to content
Docs
Get RestroPress

Filter

rpress_get_sales_tax_for_year

Updated
On this page

Filters the total sales tax collected in a year.

Runs in rpress_get_sales_tax_for_year(). The value is the sum of the _rpress_payment_tax meta on rpress_payment posts with the publish or revoked status for that year, or 0 when no year is given.

Parameters#

ParameterTypeDescription
$taxfloat|stringTotal sales tax for the year; the database sum may be a numeric string.
$yearint|nullYear the total was requested for.

Return value#

float|string. Sales tax total.

Example#

function my_adjust_sales_tax_total( $tax, $year ) {
	return (float) $tax + (float) get_option( 'my_tax_adjustment_' . $year, 0 );
}
add_filter( 'rpress_get_sales_tax_for_year', 'my_adjust_sales_tax_total', 10, 2 );

Source#

Applied in:

  • includes/tax-functions.php (line 134), in rpress_get_sales_tax_for_year()

See also#

Was this page helpful?