Skip to content
Docs
Get RestroPress

Filter

rpress_tax_classes

Updated
On this page

Filters the list of tax classes.

Returned by rpress_get_tax_classes(). The array is keyed by class slug and always contains standard, whose rate is the Tax rate setting, plus the classes saved in the rpress_tax_classes option. Each entry has name, rate (a percentage) and code. Classes added here can be assigned to menu items and categories.

Parameters#

ParameterTypeDescription
$classesarraySlug => array( name, rate, code ).

Return value#

array. Slug => array( name, rate, code ).

Example#

function my_tax_classes( $classes ) {
	$classes['reduced'] = array(
		'name' => __( 'Reduced', 'my-plugin' ),
		'rate' => 5.0,
		'code' => 'RED',
	);
	return $classes;
}
add_filter( 'rpress_tax_classes', 'my_tax_classes' );

Notes#

Rates are percentages here, for example 5.0 for 5 percent, while rpress_fooditem_tax_rate uses a decimal.

Source#

Applied in:

  • includes/tax-functions.php (line 214), in rpress_get_tax_classes()

See also#

Was this page helpful?