Skip to content
Docs
Get RestroPress

Filter

rpress_payment_key

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

ParameterTypeDescription
$keystringThe value loaded for the payment.
$payment_idintThe payment (order) ID.
$paymentRPRESS_PaymentThe 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), in RPRESS_Payment::get_key()

See also#

Was this page helpful?