Skip to content

Instantly share code, notes, and snippets.

@ciaranmahoney
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciaranmahoney/116710356af63cfc6f20 to your computer and use it in GitHub Desktop.
Save ciaranmahoney/116710356af63cfc6f20 to your computer and use it in GitHub Desktop.
Adding Australian specific address fields to Gravity forms
add_filter("gform_address_types", "aus_address", 10, 2);
function aus_address($address_types, $form_id)
{
$address_types["australia"] = array(
"label" => "Australia",
"country" => "Australia",
"zip_label" => "Postcode",
"state_label" => "State",
"states" => array("NT" => "NT", "ACT" => "ACT", "NSW" => "NSW", "QLD" => "QLD", "VIC" => "VIC", "WA" => "WA", "SA" => "SA", "TAS" => "TAS")
);
return $address_types;
}
//Modified from http://www.wpsites.co.uk/468-gravity-forms-adding-uk-specific-address-field.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment