Action
rpress_discount_save
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#
| Parameter | Type | Description |
|---|---|---|
$discount_id | int | The discount ID. |
$discount | RPRESS_Discount | The 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), inRPRESS_Discount::save()
Was this page helpful?
