Filter
rpress_single_price_option_mode
On this page
Filters whether a menu item is in single price option mode.
Runs in RPRESS_Fooditem::is_single_price_mode() with the value of the _rpress_price_options_mode meta. The result is cast to bool.
Available since RestroPress 1.0.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$ret | bool | Whether the menu item is in single price mode. |
$ID | int | Menu item ID. |
Return value#
bool. True if single price mode applies.
Example#
function my_single_price_mode( $ret, $fooditem_id ) {
return 123 === (int) $fooditem_id ? true : $ret;
}
add_filter( 'rpress_single_price_option_mode', 'my_single_price_mode', 10, 2 );
Source#
Applied in:
includes/class-rpress-fooditem.php(line 290), inRPRESS_Fooditem::is_single_price_mode()
See also#
Was this page helpful?
