Skip to content

Instantly share code, notes, and snippets.

@thewebprincess
Last active April 27, 2016 15:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save thewebprincess/7855509 to your computer and use it in GitHub Desktop.
Save thewebprincess/7855509 to your computer and use it in GitHub Desktop.
This little snippet adjusts the Gravity Forms Address fields to allow for Australian Addresses. Includes AU states/
<?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