Action
rpress_post_update_discount_status
On this page
Fires after the status of a discount is updated.
Fires in RPRESS_Discount::update_status() after wp_update_post() has run, before the method returns whether the update succeeded. The post status argument is the object's property, not re-read from the database.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$discount_id | int | The discount ID. |
$new_status | string | The new status. |
$post_status | string | The discount object's current post status property. |
Example#
function my_post_update_discount_status( $discount_id, $new_status, $post_status ) {
if ( 'inactive' === $new_status ) {
delete_transient( 'my_active_discounts' );
}
}
add_action( 'rpress_post_update_discount_status', 'my_post_update_discount_status', 10, 3 );
Source#
Fired from:
includes/class-rpress-discount.php(line 1364), inRPRESS_Discount::update_status()
See also#
Was this page helpful?
