Skip to content
Docs
Get RestroPress

Action

rpress_fooditems_category_title

Updated
On this page

Fires for each item to print its category heading.

Runs inside the item loop of the menu list templates for every menu item. Core hooks rpress_get_category_title() here, which loads the category heading template. The template decides whether the heading is printed again.

Parameters#

ParameterTypeDescription
$term_slugstringSlug of the food category being listed.
$idintID of the current menu item.
$curr_cat_varstringCategory tracker, always an empty string when the hook runs.

Example#

function my_category_title( $term_slug, $id, $curr_cat_var ) {
	if ( 'specials' === $term_slug ) {
		echo '<span class="my-specials-flag"></span>';
	}
}
add_action( 'rpress_fooditems_category_title', 'my_category_title', 20, 3 );

Source#

Fired from:

  • templates/fooditem/fooditems.php (line 84)
  • templates/fooditem/fooditems.php (line 130)
  • templates/grid/fooditems.php (line 114)
  • templates/list/fooditems.php (line 111)

See also#

Was this page helpful?