Skip to content
Docs
Get RestroPress

Action

rpress_post_delete_discount

Updated
On this page

Fires after a discount has been permanently deleted.

Runs in rpress_remove_discount() right after wp_delete_post() has force-deleted the discount. The post and its meta no longer exist, so only the ID is available.

Parameters#

ParameterTypeDescription
$discount_idintID of the discount post that was deleted.

Example#

function my_after_discount_delete( $discount_id ) {
	delete_transient( 'my_discount_cache_' . $discount_id );
}
add_action( 'rpress_post_delete_discount', 'my_after_discount_delete' );

Source#

Fired from:

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

See also#

Was this page helpful?