Skip to content
Docs
Get RestroPress

Filter

rpress_single_price_option_mode

Updated
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#

ParameterTypeDescription
$retboolWhether the menu item is in single price mode.
$IDintMenu 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), in RPRESS_Fooditem::is_single_price_mode()

See also#

Was this page helpful?