Skip to content
Docs
Get RestroPress

Filter

rpress_allergen_taxonomy_args

Updated
On this page

Filters the registration arguments of the allergen taxonomy.

Runs when rpress_allergens_register_taxonomy() registers the rpress_allergen taxonomy, which is attached to menu items (fooditem). Defaults make it non-public, non-hierarchical, shown in the admin and REST, with the product term capabilities. Changing capabilities or show_in_rest affects who can manage allergens.

Parameters#

ParameterTypeDescription
$argsarrayArguments for register_taxonomy().

Return value#

array. Taxonomy arguments.

Example#

add_filter( 'rpress_allergen_taxonomy_args', 'my_allergen_taxonomy_args', 10, 1 );
function my_allergen_taxonomy_args( $args ) {
	$args['show_in_menu'] = false;
	return $args;
}

Source#

Applied in:

  • includes/features/allergens/loader.php (line 52), in rpress_allergens_register_taxonomy()
Was this page helpful?