Skip to content
Docs
Get RestroPress

Action

rpress_pre_insert_discount

Updated
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#

ParameterTypeDescription
$metaarrayDiscount 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), in RPRESS_Discount::add()

See also#

Was this page helpful?