Filter
rpress_get_sales_tax_for_year
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#
| Parameter | Type | Description |
|---|---|---|
$tax | float|string | Total sales tax for the year; the database sum may be a numeric string. |
$year | int|null | Year 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), inrpress_get_sales_tax_for_year()
See also#
Was this page helpful?
