Action
rpress_pre_delete_discount
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#
| Parameter | Type | Description |
|---|---|---|
$discount_id | int | ID 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), inrpress_remove_discount()
See also#
Was this page helpful?
