Skip to content
Docs
Get RestroPress

Action

rpress_discount_save

Updated
On this page

Fires after a discount's pending changes are saved.

Fires in RPRESS_Discount::save() after the pending properties have been written as meta and the object has been set up again from the saved post. It does not fire when nothing was saved.

Available since RestroPress 1.0.6.

Parameters#

ParameterTypeDescription
$discount_idintThe discount ID.
$discountRPRESS_DiscountThe discount object.

Example#

function my_discount_save( $discount_id, $discount ) {
	delete_transient( 'my_discount_cache_' . $discount_id );
}
add_action( 'rpress_discount_save', 'my_discount_save', 10, 2 );

Notes#

The source docblock describes different parameters; the call passes the discount ID and the discount object.

Source#

Fired from:

  • includes/class-rpress-discount.php (line 1146), in RPRESS_Discount::save()
Was this page helpful?