Filter
rpress_is_discount_expired
On this page
Filters whether a discount has expired.
Runs at the end of RPRESS_Discount::is_expired() with the computed result. The method can also mark a discount as expired. 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 expired. |
$discount_id | int | The discount ID. |
Return value#
bool. Whether the discount has expired.
Example#
function my_rpress_is_discount_expired( $return, $discount_id ) {
return $return;
}
add_filter( 'rpress_is_discount_expired', 'my_rpress_is_discount_expired', 10, 2 );
Source#
Applied in:
includes/class-rpress-discount.php(line 1431), inRPRESS_Discount::is_expired()
Was this page helpful?
