Last active
January 23, 2020 07:26
-
-
Save andrewlimaza/35074f0948f87d14b93bddbd418166cb to your computer and use it in GitHub Desktop.
Adjust currency for Paid Memberships Pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adjust Euros for Paid Memberships Pro. Add correct thousands and decimal separator. (i.e. 1.500,99) | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_eu_format( $pmpro_currencies ) { | |
$pmpro_currencies['EUR'] = array( | |
'decimals' => '2', | |
'thousands_separator' => '.', | |
'decimal_separator' => ',', | |
'name' => __('Euros (€)', 'paid-memberships-pro' ), | |
'symbol' => '€', | |
'position' => apply_filters("pmpro_euro_position", pmpro_euro_position_from_locale()) | |
); | |
return $pmpro_currencies; | |
} | |
add_filter( 'pmpro_currencies', 'my_pmpro_eu_format' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment