Filter
rpress_get_discount_code
On this page
Filters the discount code.
Runs in RPRESS_Discount::get_code() and filters the value before it is returned to the caller. This is the value used when a customer enters the code at checkout.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | string | The discount code. |
$discount_id | int | The discount ID. |
Return value#
string. The code to use.
Example#
function my_rpress_get_discount_code( $value, $discount_id ) {
return strtoupper( $value );
}
add_filter( 'rpress_get_discount_code', 'my_rpress_get_discount_code', 10, 2 );
Source#
Applied in:
includes/class-rpress-discount.php(line 705), inRPRESS_Discount::get_code()
Was this page helpful?
