Created
November 11, 2016 16:20
-
-
Save jaredatch/be99f7b2a2cd00d6dc3af86483110595 to your computer and use it in GitHub Desktop.
WPForms add new address field scheme
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 | |
| /** | |
| * WPForms Add new address field scheme (Canada) | |
| * | |
| * @param array $schemes | |
| * @return array | |
| */ | |
| function wpf_new_address_scheme( $schemes ) { | |
| $schemes['canada'] = array( | |
| 'label' => 'Canada', | |
| 'address1_label' => 'Address Line 1', | |
| 'address2_label' => 'Address Line 2', | |
| 'city_label' => 'City', | |
| 'postal_label' => 'Code Postal', | |
| 'state_label' => 'Province', | |
| 'states' => array( | |
| 'AB' => 'Alberta', | |
| 'BC' => 'British Columbia', | |
| 'MB' => 'Manitoba', | |
| 'NB' => 'New Brunswick', | |
| 'NL' => 'Newfoundland and Labrador', | |
| 'NS' => 'Nova Scotia', | |
| 'ON' => 'Ontario', | |
| 'PE' => 'Prince Edward Island', | |
| 'WQ' => 'Quebec', | |
| 'SK' => 'Saskatchewan', | |
| ), | |
| ); | |
| return $schemes; | |
| } | |
| add_filter( 'wpforms_address_schemes', 'wpf_new_address_scheme' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works great - Thanks!