Skip to content
Docs
Get RestroPress

Filter

rpress_menu_schema_diet_map

Updated
On this page

Filters the map from dietary label slugs to schema.org RestrictedDiet values.

Runs in RPRESS_Menu_Schema::diets() for each menu item. Terms of the dietary taxonomy are matched by slug or sanitized name against this map, and the matching values become suitableForDiet with the https://schema.org/ prefix added. Values must be diet names without that prefix.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$valuearraySlug to RestrictedDiet name map.

Return value#

array. Slug to diet name map, without the schema.org prefix.

Example#

function my_diet_map( $map ) {
	$map['pescatarian'] = 'LowFatDiet';
	return $map;
}
add_filter( 'rpress_menu_schema_diet_map', 'my_diet_map' );

Notes#

The default map also covers the veg food type, which is added separately from the rpress_food_type meta.

Source#

Applied in:

  • includes/features/qr-schema/class-rpress-menu-schema.php (line 504), in RPRESS_Menu_Schema::diets()

See also#

Was this page helpful?