Action
rpress_fooditem_shortcode_item
On this page
Fires to print each menu item in the menu list templates.
Runs inside the item loop of the menu list templates once for each menu item. Core hooks rpress_fooditem_shortcode_item() here, which stores the arguments in globals and loads the single item template of the selected layout. Unhook it to supply your own item markup.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$atts | array | The menu item shortcode attributes. |
$i | int | The position of the item within the current category, starting at 1. |
Example#
function my_menu_item_marker( $atts, $i ) {
if ( 1 === $i ) {
echo '<span class="my-first-item"></span>';
}
}
add_action( 'rpress_fooditem_shortcode_item', 'my_menu_item_marker', 5, 2 );
Source#
Fired from:
templates/fooditem/fooditems.php(line 85)templates/fooditem/fooditems.php(line 131)templates/grid/fooditems.php(line 119)templates/list/fooditems.php(line 112)
See also#
Was this page helpful?
