Skip to content
Docs
Get RestroPress

Action

rpress_discount_increase_use_count

Updated
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#

ParameterTypeDescription
$usesintNew discount usage count.
$IDintDiscount ID.
$codestringDiscount 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), in RPRESS_Discount::increase_usage()

See also#

Was this page helpful?