Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save michaelbeil/ad67063baae966cac28c3bee99e836d7 to your computer and use it in GitHub Desktop.

Select an option

Save michaelbeil/ad67063baae966cac28c3bee99e836d7 to your computer and use it in GitHub Desktop.
PMPro change default country
<?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