Using Gravity Forms ‘gform_currency’ PHP filter

The gform_currency filter allows you to override the currency configured on the Forms > Settings page, affecting all forms.

Usage

add_filter('gform_currency', 'your_function_name');

Parameters

  • $currency (string): The currency code to be filtered.

More information

See Gravity Forms Docs: gform_currency

Examples

Force the currency to USD

This example changes the currency to USD (US dollars).

add_filter('gform_currency', 'usd_currency');

function usd_currency($currency) {
    return 'USD';
}

Force the currency to EUR

This example changes the currency to EUR (Euros).

add_filter('gform_currency', 'eur_currency');

function eur_currency($currency) {
    return 'EUR';
}

Force the currency to GBP

This example changes the currency to GBP (British Pounds).

add_filter('gform_currency', 'gbp_currency');

function gbp_currency($currency) {
    return 'GBP';
}

Force the currency to JPY

This example changes the currency to JPY (Japanese Yen).

add_filter('gform_currency', 'jpy_currency');

function jpy_currency($currency) {
    return 'JPY';
}

Force the currency to AUD

This example changes the currency to AUD (Australian Dollars).

add_filter('gform_currency', 'aud_currency');

function aud_currency($currency) {
    return 'AUD';
}