Skip to content
Docs
Get RestroPress

Filter

rpress_payment_currency_default

Updated
On this page

Filters the currency assigned to a payment that has no stored currency.

Applied in RPRESS_Payment::setup_currency only when the payment meta has no currency value. The default is the store currency returned by rpress_get_currency().

Parameters#

ParameterTypeDescription
$currencystringThe store currency code.
$paymentRPRESS_PaymentThe payment object.

Return value#

string. The currency code.

Example#

function my_payment_currency_default( $currency, $payment ) {
	return 'USD';
}
add_filter( 'rpress_payment_currency_default', 'my_payment_currency_default', 10, 2 );

Notes#

Affects how older payments without a stored currency are displayed.

Source#

Applied in:

  • includes/payments/class-rpress-payment.php (line 1920), in RPRESS_Payment::setup_currency()

See also#

Was this page helpful?