Skip to content
Docs
Get RestroPress

Filter

rpress_fooditem_allergen_traces

Updated
On this page

Filters the allergens a menu item may contain traces of.

Returned by rpress_get_fooditem_allergen_traces(). Traces come from the item's stored trace term IDs, minus any allergen the item already contains, fetched ordered by name.

Parameters#

ParameterTypeDescription
$termsWP_Term[]Allergen terms marked as traces.
$fooditem_idintMenu item (fooditem) ID.

Return value#

WP_Term[]. Allergen terms.

Example#

add_filter( 'rpress_fooditem_allergen_traces', 'my_fooditem_allergen_traces', 10, 2 );
function my_fooditem_allergen_traces( $terms, $fooditem_id ) {
	return $terms;
}

Source#

Applied in:

  • includes/features/allergens/functions.php (line 74), in rpress_get_fooditem_allergen_traces()

See also#

Was this page helpful?