Skip to content
Docs
Get RestroPress

Filter

rpress_dietary_labels_html

Updated
On this page

Filters the dietary labels HTML for a menu item.

Runs at the end of rpress_get_dietary_labels_html() after the chips are built from the item's terms in the dietary taxonomy. The value is a wrapper div with class rpress_fooditem_dietary containing the chips.

Parameters#

ParameterTypeDescription
$htmlstringDietary labels HTML.
$fooditem_idintMenu item ID.
$termsWP_Term[]Dietary terms attached to the menu item.

Return value#

string. Dietary labels HTML.

Example#

function my_dietary_labels_html( $html, $fooditem_id, $terms ) {
	return '<div class="my-dietary-wrap">' . $html . '</div>';
}
add_filter( 'rpress_dietary_labels_html', 'my_dietary_labels_html', 10, 3 );

Source#

Applied in:

  • includes/template-functions.php (line 1236), in rpress_get_dietary_labels_html()

See also#

Was this page helpful?