Filter
rpress_is_discount_maxed_out
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#
| Parameter | Type | Description |
|---|---|---|
$return | bool | Whether the discount has reached its maximum uses. |
$discount_id | int | The 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), inRPRESS_Discount::is_maxed_out()
Was this page helpful?
