Action
rpress_discount_increase_use_count
On this page
Fires after a discount's usage count has been increased.
Runs inside RPRESS_Discount::increase_usage() once the uses meta is saved. If the new count equals the discount's maximum uses, the discount has already been set to inactive at this point.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$uses | int | New discount usage count. |
$ID | int | Discount ID. |
$code | string | Discount code. |
Example#
function my_log_discount_use( $uses, $discount_id, $code ) {
error_log( sprintf( 'Discount %s (#%d) used %d times.', $code, $discount_id, $uses ) );
}
add_action( 'rpress_discount_increase_use_count', 'my_log_discount_use', 10, 3 );
Source#
Fired from:
includes/class-rpress-discount.php(line 1883), inRPRESS_Discount::increase_usage()
See also#
Was this page helpful?
