Skip to content

Instantly share code, notes, and snippets.

@pramodjodhani
Created May 26, 2026 12:19
Show Gist options
  • Select an option

  • Save pramodjodhani/4d7dbeaa684273ecc90d1b72e2313c73 to your computer and use it in GitHub Desktop.

Select an option

Save pramodjodhani/4d7dbeaa684273ecc90d1b72e2313c73 to your computer and use it in GitHub Desktop.
Reorder Gravity Forms currencies
<?php
/**
* Reorder Gravity Forms currencies: RON, EUR, USD (then all others).
* Share this snippet with the customer.
*/
add_filter( 'gform_currencies', 'idea_mcg_reorder_gravity_form_currencies', 20 );
function idea_mcg_reorder_gravity_form_currencies( $currencies ) {
$priority_order = array( 'RON', 'EUR', 'USD' );
$ordered = array();
foreach ( $priority_order as $code ) {
if ( isset( $currencies[ $code ] ) ) {
$ordered[ $code ] = $currencies[ $code ];
}
}
foreach ( $currencies as $code => $data ) {
if ( ! isset( $ordered[ $code ] ) ) {
$ordered[ $code ] = $data;
}
}
return $ordered;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment