Skip to content
Docs
Get RestroPress

Filter

rpress_fooditem_inner_class

Updated
On this page

Filters the CSS class of the inner wrapper of a menu item card.

Runs in the single item templates for the fooditem, grid, list and modern layouts. The returned string is used for the class attribute of the card inner element.

Parameters#

ParameterTypeDescription
$classstringThe CSS class, by default rpress_fooditem_inner.
$fooditem_idintID of the menu item.
$attsarrayThe shortcode attributes of the current list.
$iintPosition of the item in its category, starting at 1.

Return value#

string. The class string.

Example#

function my_fooditem_inner_class( $class, $fooditem_id, $atts, $i ) {
	return $class . ' my-inner-' . absint( $i );
}
add_filter( 'rpress_fooditem_inner_class', 'my_fooditem_inner_class', 10, 4 );

Source#

Applied in:

  • templates/fooditem/single.php (line 34)
  • templates/grid/single.php (line 77)
  • templates/list/single.php (line 53)
  • templates/packs/modern/list/single.php (line 48)

See also#

Was this page helpful?