Ive created this for irish addresses.. you can just add this to the themes functions.php file
Note: but Im also looking for a way to simply remove zip / postal code.
my issue is that the address field is required so even hiding it via css doesnt work and causes a validation error.
add_filter("gform_address_types", "irish_address", 10, 2);
function irish_address($address_types, $form_id){
$address_types["irish"] = array(
"label" => "Irish",
"country" => "Ireland",
"zip_label" => "Postcode",
"state_label" => "County",
"states" => array("Antrim"=>"Antrim","Armagh"=>"Armagh","Carlow"=>"Carlow","Cavan"=>"Cavan","Clare"=>"Clare","Cork"=>"Cork","Derry"=>"Derry","Donegal"=>"Donegal","Down"=>"Down","Dublin"=>"Dublin","Fermanagh"=>"Fermanagh","Galway"=>"Galway","Kerry"=>"Kerry","Kildare"=>"Kildare", "Kilkenny"=>"Kilkenny","Laois"=>"Laois","Leitrim"=>"Leitrim","Limerick"=>"Limerick","Longford"=>"Longford","Louth"=>"Louth","Mayo"=>"Mayo","Meath"=>"Meath","Monaghan"=>"Monaghan","Offaly"=>"Offaly","Roscommon"=>"Roscommon","Sligo"=>"Sligo","Tipperary"=>"Tipperary","Tyrone"=>"Tyrone","Waterford"=>"Waterford","Westmeath"=>"Westmeath","Wexford"=>"Wexford","Wicklow"=>"Wicklow")
);
return $address_types;
}
Posted 12 years ago on Monday October 22, 2012 |
Permalink