Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.