Skip to content

Instantly share code, notes, and snippets.

@mauriciogofas
Forked from dancameron/functions.php
Last active August 29, 2015 14:14
Show Gist options
  • Save mauriciogofas/53b61243cc547665c54e to your computer and use it in GitHub Desktop.
Save mauriciogofas/53b61243cc547665c54e to your computer and use it in GitHub Desktop.
Custom States and Countries for Sprout Invoices
<?php
/**
* This function file is loaded after the parent theme's function file. It's a great way to override functions, e.g. add_image_size sizes.
*
*
*/
function custom_states() {
return array(
'Mexico' => array(
'AGU' => 'Aguascalientes',
'BCN' => 'Baja California',
'BCS' => 'Baja California Sur',
'CAM' => 'Campeche',
'CHP' => 'Chiapas',
'CHH' => 'Chihuahua',
'COA' => 'Coahuila',
'COL' => 'Colima',
'DIF' => 'Distrito Federal',
'DUR' => 'Durango',
'GUA' => 'Guanajuato',
'GRO' => 'Guerrero',
'HID' => 'Hidalgo',
'JAL' => 'Jalisco',
'MEX' => 'Estado de Mexico',
'MIC' => 'Michoacan',
'MOR' => 'Morelos',
'NAY' => 'Nayarit',
'NLE' => 'Nuevo Leon',
'OAX' => 'Oaxaca',
'PUE' => 'Puebla',
'QUE' => 'Queretaro',
'ROO' => 'Quintana Roo',
'SLP' => 'San Luis Potosi',
'SIN' => 'Sinaloa',
'SON' => 'Sonora',
'TAB' => 'Tabasco',
'TAM' => 'Tamaulipas',
'TLA' => 'Tlaxcala',
'VER' => 'Veracruz',
'YUC' => 'Yucatan',
'ZAK' => 'Zacatecas',
),
'United States' => array(
'AL' => 'Alabama',
'AK' => 'Alaska',
'AS' => 'American Samoa',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'AE' => 'Armed Forces - Europe',
'AP' => 'Armed Forces - Pacific',
'AA' => 'Armed Forces - USA/Canada',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',
'DC' => 'District of Columbia',
'FM' => 'Federated States of Micronesia',
'FL' => 'Florida',
'GA' => 'Georgia',
'GU' => 'Guam',
'HI' => 'Hawaii',
'ID' => 'Idaho',
'IL' => 'Illinois',
'IN' => 'Indiana',
'IA' => 'Iowa',
'KS' => 'Kansas',
'KY' => 'Kentucky',
'LA' => 'Louisiana',
'ME' => 'Maine',
'MH' => 'Marshall Islands',
'MD' => 'Maryland',
'MA' => 'Massachusetts',
'MI' => 'Michigan',
'MN' => 'Minnesota',
'MS' => 'Mississippi',
'MO' => 'Missouri',
'MT' => 'Montana',
'NE' => 'Nebraska',
'NV' => 'Nevada',
'NH' => 'New Hampshire',
'NJ' => 'New Jersey',
'NM' => 'New Mexico',
'NY' => 'New York',
'NC' => 'North Carolina',
'ND' => 'North Dakota',
'OH' => 'Ohio',
'OK' => 'Oklahoma',
'OR' => 'Oregon',
'PA' => 'Pennsylvania',
'PR' => 'Puerto Rico',
'RI' => 'Rhode Island',
'SC' => 'South Carolina',
'SD' => 'South Dakota',
'TN' => 'Tennessee',
'TX' => 'Texas',
'UT' => 'Utah',
'VT' => 'Vermont',
'VI' => 'Virgin Islands',
'VA' => 'Virginia',
'WA' => 'Washington',
'WV' => 'West Virginia',
'WI' => 'Wisconsin',
'WY' => 'Wyoming',
),
'Canada' => array(
'AB' => 'Alberta',
'BC' => 'British Columbia',
'MB' => 'Manitoba',
'NB' => 'New Brunswick',
'NF' => 'Newfoundland',
'NT' => 'Northwest Territories',
'NS' => 'Nova Scotia',
'NU' => 'Nunavut',
'ON' => 'Ontario',
'PE' => 'Prince Edward Island',
'QC' => 'Quebec',
'SK' => 'Saskatchewan',
'YT' => 'Yukon Territory'
)
);
}
add_filter('sprout_state_options', 'custom_states');
function custom_country() {
return array(
'MX' => 'Mexico',
'US' => 'United States',
'CN' => 'Canada'
);
}
add_filter('sprout_country_options', 'custom_country');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment