Forked from matadorjobs/snippet_change_state_to_US_states_dropdown.php
Created
May 26, 2021 02:10
-
-
Save blueprintmrk/0176182155baf2a8356232044e7c6dcb to your computer and use it in GitHub Desktop.
Change the state/province application form field to a drop-down of US states and territories.
This file contains hidden or 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 // omit opening PHP tag | |
add_filter( 'matador_application_fields_structure', 'mdocs_change_state_field_to_US_states_dropdown', 50, 1 ); | |
/** | |
* Matador Change "State" to US States Dropdown | |
* | |
* Change the state/province application form field to a drop-down (<select>) of US states and territories. | |
* | |
* @since 2021-02-22 | |
* | |
* @param array $fields Array of Form Fields | |
* | |
* @return array | |
*/ | |
function mdocs_change_state_field_to_US_states_dropdown( $fields ) { | |
$fields['state']['type'] = 'select'; | |
$fields['state']['options'] = array( | |
'Alabama' => 'Alabama', | |
'Alaska' => 'Alaska', | |
'American Samoa' => 'American Samoa', | |
'Arizona' => 'Arizona', | |
'Arkansas' => 'Arkansas', | |
'California' => 'California', | |
'Colorado' => 'Colorad', | |
'Connecticut' => 'Connecticut', | |
'Deleware' => 'Deleware', | |
'District of Columbia' => 'District of Columbia', | |
'Federated States of Micronesia' => 'Federated States of Micronesia', | |
'Florida' => 'Florida', | |
'Georgia' => 'Georgia', | |
'Guam' => 'Guam', | |
'Hawaii' => 'Hawaii', | |
'Idaho' => 'Idaho', | |
'Illinois' => 'Illinois', | |
'Indiana' => 'Indiana', | |
'Iowa' => 'Iowa', | |
'Kansas' => 'Kansas', | |
'Kentucky' => 'Kentucky', | |
'Louisiana' => 'Louisiana', | |
'Maine' => 'Maine', | |
'Marshall Islands' => 'Marshall Islands', | |
'Maryland' => 'Maryland', | |
'Massachusetts' => 'Massachusetts', | |
'Michigan' => 'Michigan', | |
'Minnesota' => 'Minnesota', | |
'Mississippi' => 'Mississippi', | |
'Missouri' => 'Missouri', | |
'Montana' => 'Montana', | |
'Nebraska' => 'Nebraska', | |
'Nevada' => 'Nevada', | |
'New Hampshire' => 'New Hampshire', | |
'New Jersey' => 'New Jersey', | |
'New Mexico' => 'New Mexico', | |
'New York' => 'New York', | |
'North Carolina' => 'North Carolina', | |
'North Dakota' => 'North Dakota', | |
'Northern Mariana Islands' => 'Northern Mariana Islands', | |
'Ohio' => 'Ohio', | |
'Oklahoma' => 'Oklahoma', | |
'Oregon' => 'Oregon', | |
'Palau' => 'Palau', | |
'Pennsylvania' => 'Pennsylvania', | |
'Puerto Rico' => 'Puerto Rico', | |
'Rhode Island' => 'Rhode Island', | |
'South Carolina' => 'South Carolina', | |
'South Dakota' => 'South Dakota', | |
'Tennessee' => 'Tennessee', | |
'Texas' => 'Texas', | |
'Utah' => 'Utah', | |
'Vermont' => 'Vermont', | |
'Virgin Islands' => 'Virgin Islands', | |
'Virginia' => 'Virginia', | |
'Washington' => 'Washington', | |
'West Virginia' => 'West Virginia', | |
'Wisconsin' => 'Wisconsin', | |
'Wyoming' => 'Wyoming', | |
'Armed Forces Europe' => 'Armed Forces Africa \ Canada \ Europe \ Middle East', | |
'Armed Forces America' => 'Armed Forces America (Except Canada)', | |
'Armed Forces Pacific' => 'Armed Forces Pacific', | |
); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment