Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change EU Danish Krone currency format
<?php // do not include in Customizations plugin if copying and pasting
/**
* This code gist illustrates a way to customize the format of how your currency displays.
*
* In this example, we will change the PMPro Danish Krone currency
*
* from DKK 1,495.00
* to DKK 1 495,00
*
* Adjust this code gist to suit your needs for currency.
*
* Currency information can be found in this core plugin file `/paid-memberships-pro/includes/currencies.php`
*
* Add this code below to your PMPro Customizations Plugin
* - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**
* pmpro_eu_dkk_format This function changes the values of a specific keys for a currency in the `$pmpro_currencies` array.
*
* @param array $pmpro_currencies The currency array created by PMPro
* @return array The adjusted currency array
*/
function pmpro_eu_dkk_format( $pmpro_currencies ) {
$pmpro_currencies['DKK'] = array(
'name' => __( 'Danish Krone', 'paid-memberships-pro' ),
'decimals' => '2',
'thousands_separator' => '&nbsp;',
'decimal_separator' => ',',
'symbol' => 'DKK&nbsp;',
'position' => 'left',
);
return $pmpro_currencies;
}
add_filter( 'pmpro_currencies', 'pmpro_eu_dkk_format' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.