Skip to content
Docs
Get RestroPress

Filter

rpress_get_fooditem_type

Updated
On this page

Filters the type of a menu item, default or bundle.

Runs at the end of RPRESS_Fooditem::get_type(). The value comes from the _rpress_product_type meta and falls back to default. Unlike some other getters, this filter is applied on every call.

Parameters#

ParameterTypeDescription
$typestringMenu item type, default or bundle.
$IDintMenu item ID.

Return value#

string. The menu item type.

Example#

function my_fooditem_type( $type, $fooditem_id ) {
	return $type;
}
add_filter( 'rpress_get_fooditem_type', 'my_fooditem_type', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-fooditem.php (line 340), in RPRESS_Fooditem::get_type()

See also#

Was this page helpful?