This little snippet adjusts the Gravity Forms Address fields to allow for Australian Addresses. Includes AU states/
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 | |
// Gravity Forms Custom Addresses (Australia) | |
add_filter('gform_address_types', 'australian_address', 10, 2); | |
function australian_address( $address_types, $form_id ) { | |
$address_types['australia'] = array( | |
'label' => 'Australia', //labels the dropdown | |
'country' => 'Australia', //sets Australia as default country | |
'zip_label' => 'Post Code', //what it says | |
'state_label' => 'State', //as above | |
'states' => array( | |
'', | |
'Australian Capital Territory', | |
'New South Wales', | |
'Northern Territory', | |
'Queensland', | |
'South Australia', | |
'Tasmania', 'Victoria', | |
'Western Australia' | |
) | |
); | |
return $address_types; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment