Skip to content
Docs
Get RestroPress

Filter

rpress_update_discount

Updated
On this page

Filters the discount meta before an existing discount is updated.

Runs in RPRESS_Discount::update() after the meta array is built from the supplied arguments, before the post and meta are written.

Available since RestroPress 1.0.6.

Parameters#

ParameterTypeDescription
$metaarrayDiscount meta to be stored.
$discount_idintThe discount ID.

Return value#

array. The discount meta to store.

Example#

function my_update_discount( $meta, $discount_id ) {
	$meta['code'] = strtoupper( $meta['code'] );
	return $meta;
}
add_filter( 'rpress_update_discount', 'my_update_discount', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-discount.php (line 1240), in RPRESS_Discount::update()

See also#

Was this page helpful?