Skip to content
Docs
Get RestroPress

Filter

rpress_is_discount_maxed_out

Updated
On this page

Filters whether a discount has reached its maximum uses.

Runs at the end of RPRESS_Discount::is_maxed_out() with the computed result. Returning a different value changes whether the discount is accepted at checkout.

Available since RestroPress 1.0.6.

Parameters#

ParameterTypeDescription
$returnboolWhether the discount has reached its maximum uses.
$discount_idintThe discount ID.

Return value#

bool. Whether the discount has reached its maximum uses.

Example#

function my_rpress_is_discount_maxed_out( $return, $discount_id ) {
	return $return;
}
add_filter( 'rpress_is_discount_maxed_out', 'my_rpress_is_discount_maxed_out', 10, 2 );

Source#

Applied in:

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