-
-
Save gregoirenoyelle/0a28f8d487742998f0a771911d414b56 to your computer and use it in GitHub Desktop.
Add a new country to countries list
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 | |
add_filter( 'woocommerce_countries', 'gnwooc2_ajouter_pays' ); | |
function gnwooc2_ajouter_pays( $countries ) { | |
$new_countries = array( | |
'NIRE' => __( 'Irlande du NORD', 'woocommerce' ), | |
); | |
return array_merge( $countries, $new_countries ); | |
} | |
add_filter( 'woocommerce_continents', 'gnwooc2_ajouter_pays_continents' ); | |
function gnwooc2_ajouter_pays_continents( $continents ) { | |
$continents['EU']['countries'][] = 'NIRE'; | |
return $continents; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment