Created
March 31, 2025 13:30
Force "sv" for locale for Paid Memberships Pro "sv_SE" locales
This file contains hidden or 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 | |
/** | |
* Force the locale to be `-sv.mo/.po` if `sv_SE` is detected as the locale. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* This should resolve issues temporarily if you are using Swedish Locale. | |
**/ | |
function my_pmpro_force_locale_for_swedish( $locale, $plugin ) { | |
if ( $plugin === 'paid-memberships-pro' && $locale === 'sv_SE' ) { | |
$locale = 'sv'; | |
} | |
return $locale; | |
} | |
add_filter( 'plugin_locale', 'my_pmpro_force_locale_for_swedish', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment