Filter
rpress_payment_key
On this page
Filters the purchase key returned for a payment.
Runs when the unique purchase key of the order property is read from an RPRESS_Payment object (for example $payment->key), through the object's magic getter. Only the returned value changes; the stored meta is not modified. Reads made inside the class itself go straight to the property and are not filtered.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$key | string | The value loaded for the payment. |
$payment_id | int | The payment (order) ID. |
$payment | RPRESS_Payment | The payment object being read. |
Return value#
string. The (possibly modified) value returned for the property.
Example#
add_filter( 'rpress_payment_key', 'my_lowercase_payment_key', 10, 3 );
function my_lowercase_payment_key( $key, $payment_id, $payment ) {
return strtolower( $key );
}
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 2292), inRPRESS_Payment::get_key()
See also#
Was this page helpful?
