Created
December 12, 2015 23:46
-
-
Save eighty20results/c1f0c33fa837a0a47ee0 to your computer and use it in GitHub Desktop.
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 | |
function my_add_pmpro_state_abbrev( $states ) | |
{ | |
// Canadian province abbreviations | |
$provinces = array( | |
"AB", | |
"BC", | |
"MB", | |
"NB", | |
"NL", | |
"NS", | |
"NT", | |
"NU", | |
"ON", | |
"PE", | |
"QC", | |
"SK", | |
"YT" | |
); | |
// Merge with received US state abbreviations (append to end) | |
return array_merge( $states, $provinces); | |
} | |
add_filter('pmpro_states_abbreviations', 'my_add_pmpro_state_abbrev'); | |
function my_add_pmpro_states( $states ) | |
{ | |
// Canadian province abbreviations | |
$provinces = array( | |
"AB" => "Alberta", | |
"BC" => "British Columbia", | |
"MB" => "Manitoba", | |
"NB" => "New Brunswick", | |
"NL" => "Newfoundland and Labrador", | |
"NS" => "Nova Scotia", | |
"NT" => "Northwest Territories", | |
"NU" => "Nunavut", | |
"ON" => "Ontario", | |
"PE" => "Prince Edward Island", | |
"QC" => "Quebec", | |
"SK" => "Saskatchewan", | |
"YT" => "Yukon" | |
); | |
// Merge with received US state abbreviations (append to end) | |
return array_merge( $states, $provinces); | |
} | |
add_filter('pmpro_states', 'my_add_pmpro_states'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment