Skip to content
Docs
Get RestroPress

Filter

rpress_discount_is_not_global

Updated
On this page

Filters whether a discount is restricted to specific menu items.

Runs in RPRESS_Discount::get_is_not_global(). When true, the discount applies only to the required menu items rather than to the whole cart. The filtered value is cast to bool before it is returned.

Available since RestroPress 1.0.6.

Parameters#

ParameterTypeDescription
$is_not_globalboolWhether the discount is not applied globally.
$discount_idintThe discount ID.

Return value#

bool. Whether the discount is not global.

Example#

function my_discount_is_not_global( $is_not_global, $discount_id ) {
	return $is_not_global;
}
add_filter( 'rpress_discount_is_not_global', 'my_discount_is_not_global', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-discount.php (line 993), in RPRESS_Discount::get_is_not_global()
Was this page helpful?