Filter
rpress_fooditem_quantity_disabled
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#
| Parameter | Type | Description |
|---|---|---|
$ret | bool | Whether quantities are disabled. |
$ID | int | Menu 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), inRPRESS_Fooditem::quantities_disabled()
Was this page helpful?
