Filter
rpress_dietary_labels_html
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#
| Parameter | Type | Description |
|---|---|---|
$html | string | Dietary labels HTML. |
$fooditem_id | int | Menu item ID. |
$terms | WP_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), inrpress_get_dietary_labels_html()
See also#
Was this page helpful?
