Gravity Forms Custom Templates

Im trying to further customise my Gravity Forms “Address” labels. At the moment they read “Street Address”, “City” and “ZIP / Postal Code”.

I, for example, want to change “ZIP / Postal Code” to “Post code”. Does anyone know if you can use templates to override these values in your theme without messing up the core GF files?

Read More

common.php seems to be the place where these values are stored:

public static function get_address_types($form_id){

    $addressTypes = array(
        "international" =>  array("label" => __("International", "gravityforms"),"zip_label" => apply_filters("gform_address_zip_{$form_id}",apply_filters("gform_address_zip", __("ZIP / Postal Code", "gravityforms"), $form_id), $form_id),"state_label" => apply_filters("gform_address_state_{$form_id}",apply_filters("gform_address_state",__("State / Province / Region", "gravityforms"), $form_id), $form_id)),
        );

    return apply_filters("gform_address_types_{$form_id}", apply_filters("gform_address_types", $addressTypes, $form_id), $form_id);
}

Any help would be appreciated. Thanks in advance.

Related posts

2 comments

  1. You can change a bunch in one hit with the gform_address_types filter, like this:

    /**
    * customise the Address field labels
    * @param array $addressTypes
    * @return array
    */
    add_filter('gform_address_types', function ($addressTypes) {
        $addressTypes['international']['zip_label'] = 'Postcode';
        $addressTypes['international']['state_label'] = 'State';
    
        return $addressTypes;
    });
    

Comments are closed.