Skip to content
Docs
Get RestroPress

Action

rpress_pre_delete_discount

Updated
On this page

Fires before a discount is permanently deleted.

Runs in rpress_remove_discount() immediately before wp_delete_post() is called with force delete enabled. The discount post still exists at this point, so its meta can be read.

Parameters#

ParameterTypeDescription
$discount_idintID of the discount post being deleted.

Example#

function my_before_discount_delete( $discount_id ) {
	error_log( 'Deleting discount ' . get_the_title( $discount_id ) );
}
add_action( 'rpress_pre_delete_discount', 'my_before_discount_delete' );

Source#

Fired from:

  • includes/discount-functions.php (line 196), in rpress_remove_discount()

See also#

Was this page helpful?