Filter
rpress_payment_discounts
On this page
Filters the discount codes of a payment.
Applied when the discounts property of an RPRESS_Payment is read. The filter runs on every read of the property, not only when the payment is loaded.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$discounts | string|array | The discount codes stored on the payment. |
$payment_id | int | ID of the payment. |
$payment | RPRESS_Payment | The payment object. |
Return value#
string|array. The discounts to return.
Example#
function my_payment_discounts( $discounts, $payment_id, $payment ) {
return $discounts;
}
add_filter( 'rpress_payment_discounts', 'my_payment_discounts', 10, 3 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 2190), inRPRESS_Payment::get_discounts()
Was this page helpful?
