Action
rpress_pre_insert_discount
On this page
Fires before a discount is added to the database.
Fires in RPRESS_Discount::add() after the meta has been filtered and before the rpress_discount post is created.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$meta | array | Discount meta that will be stored. |
Example#
function my_pre_insert_discount( $meta ) {
error_log( 'Creating discount ' . $meta['code'] );
}
add_action( 'rpress_pre_insert_discount', 'my_pre_insert_discount' );
Source#
Fired from:
includes/class-rpress-discount.php(line 1186), inRPRESS_Discount::add()
See also#
Was this page helpful?
