Filter
rpress_is_discount_single_use
On this page
Filters whether a discount can be used only once per customer.
Runs when the single-use flag of a discount is read, in both RPRESS_Discount::get_is_single_use() and RPRESS_Discount::is_single_use(). The filtered value is cast to bool before it is returned.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$is_single_use | bool | Whether the discount is limited to one use per customer. |
$discount_id | int | The discount ID. |
Return value#
bool. Whether the discount is single use.
Example#
function my_is_discount_single_use( $is_single_use, $discount_id ) {
return $is_single_use;
}
add_filter( 'rpress_is_discount_single_use', 'my_is_discount_single_use', 10, 2 );
Notes#
Fired from two methods with the same arguments.
Source#
Applied in:
includes/class-rpress-discount.php(line 975), inRPRESS_Discount::get_is_single_use()includes/class-rpress-discount.php(line 1501), inRPRESS_Discount::is_single_use()
Was this page helpful?
