Filter
rpress_update_discount
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#
| Parameter | Type | Description |
|---|---|---|
$meta | array | Discount meta to be stored. |
$discount_id | int | The 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), inRPRESS_Discount::update()
See also#
Was this page helpful?
