Forked from andrewlimaza/pmpro-change-default-country.php
Last active
June 27, 2023 15:14
-
-
Save michaelbeil/ad67063baae966cac28c3bee99e836d7 to your computer and use it in GitHub Desktop.
PMPro change default country
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 | |
| /** | |
| * Change default country | |
| * List of all country ISO codes: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| // Default Country | |
| function my_set_pmpro_default_country( $default_country ) { | |
| // Set country ISO code to "RO" for Romania | |
| $default_country = "RO"; | |
| return $default_country; | |
| } | |
| add_filter( 'pmpro_default_country', 'my_set_pmpro_default_country' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment