Skip to content
Docs
Get RestroPress

Action

rpress_pre_update_discount_status

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

ParameterTypeDescription
$discount_idintThe discount ID.
$new_statusstringThe new status.
$post_statusstringThe 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), in RPRESS_Discount::update_status()

See also#

Was this page helpful?