Action
rpress_post_insert_discount
On this page
Fires after a discount is added to the database.
Fires in RPRESS_Discount::add() after the post and its meta have been created, before the discount object is set up from the new post.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$meta | array | Discount meta that was stored. |
$discount_id | int | The ID of the new discount. |
Example#
function my_post_insert_discount( $meta, $discount_id ) {
update_post_meta( $discount_id, '_my_created_by', get_current_user_id() );
}
add_action( 'rpress_post_insert_discount', 'my_post_insert_discount', 10, 2 );
Source#
Fired from:
includes/class-rpress-discount.php(line 1216), inRPRESS_Discount::add()
See also#
Was this page helpful?
