Last active
November 19, 2021 16:24
-
-
Save kimcoleman/1880f7fc69e51812701cab2ebd5cf547 to your computer and use it in GitHub Desktop.
Use the pmpro_default_country filter to pre-set the dropdown at checkout to your country of choice.
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 | |
/** Use the pmpro_default_country filter to pre-set the dropdown at checkout to your country of choice. | |
* | |
* 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. | |
* | |
*/ | |
function my_set_pmpro_default_country( $default_country ) { | |
// Set country code to "GB" for United Kingdom. | |
$default_country = "GB"; | |
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