Skip to content
Docs
Get RestroPress

Filter

rpress_dietary_args

Updated
On this page

Filters the arguments used to register the dietary label taxonomy.

Runs while the menu taxonomies are registered on init, immediately before register_taxonomy() for the dietary label taxonomy (dietary). The defaults are non-hierarchical, show_ui, show_in_rest, query_var 'dietary', a rewrite slug built from the menu item slug plus '/dietary', and capabilities mapped to the product term capabilities. The labels have already passed through rpress_dietary_labels.

Parameters#

ParameterTypeDescription
$dietary_argsarrayArguments for register_taxonomy().

Return value#

array. The registration arguments.

Example#

add_filter( 'rpress_dietary_args', 'my_dietary_args', 10, 1 );
function my_dietary_args( $dietary_args ) {
	$dietary_args['show_in_rest'] = true;
	return $dietary_args;
}

Source#

Applied in:

  • includes/post-types.php (line 277), in rpress_setup_fooditem_taxonomies()

See also#

Was this page helpful?