Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add store locale to allowed country list in WooCommerce's Stripe plugin which whitelists countries since 4.5.1
function moso_add_country_to_stripe( $countries ) {
$wc_default_country = substr( get_option( 'woocommerce_default_country' ), 0, 2 );
if ( ! in_array( $wc_default_country, $countries ) ) {
$countries[] = $wc_default_country;
return $countries;
add_filter('wc_stripe_supported_countries', 'moso_add_country_to_stripe');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment