Action
rpress_pre_update_discount_status
On this page
Fires before the status of a discount is updated.
Fires in RPRESS_Discount::update_status() before the post status is changed with wp_update_post(). It runs for any status change, including those made by save().
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_pre_update_discount_status( $discount_id, $new_status, $post_status ) {
error_log( 'Discount ' . $discount_id . ': ' . $post_status . ' -> ' . $new_status );
}
add_action( 'rpress_pre_update_discount_status', 'my_pre_update_discount_status', 10, 3 );
Source#
Fired from:
includes/class-rpress-discount.php(line 1348), inRPRESS_Discount::update_status()
See also#
Was this page helpful?
