Skip to content
Docs
Get RestroPress

Filter

rpress_fooditem_quantity_disabled

Updated
On this page

Filters whether the quantity input is disabled for a menu item.

Runs in RPRESS_Fooditem::quantities_disabled() with the boolean value of the _rpress_quantities_disabled meta. Unlike most getters, the result is returned without a type cast.

Parameters#

ParameterTypeDescription
$retboolWhether quantities are disabled.
$IDintMenu item ID.

Return value#

bool. True to disable the quantity input.

Example#

function my_quantity_disabled( $ret, $fooditem_id ) {
	return 123 === (int) $fooditem_id ? true : $ret;
}
add_filter( 'rpress_fooditem_quantity_disabled', 'my_quantity_disabled', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-fooditem.php (line 573), in RPRESS_Fooditem::quantities_disabled()
Was this page helpful?