bookmark_bordergform_address_display_format

Description

This filter can be used to change the way addresses are formatted.

Usage

add_filter( 'gform_address_display_format', 'change_address' );

Parameters

  • $format string

    The format to be filtered.
    Possible values: default and zip_before_city

    • default

      Addresses are formatted in the following order (Street, Street2, City, State, Zip Code, Country)

    • zip_before_city

      Addresses are formatted in the following order (Street, Street2, Zip, City, State, Country)

Examples

This example demonstrates how to change the address format to zip_before_city

add_filter( 'gform_address_display_format', 'address_format' );
function address_format( $format ) {
    return 'zip_before_city';
}

Source Code

This filter is located in the following methods in includes/fields/class-gf-field-address.php

  • GF_Field_Address::get_field_input()
  • GF_Field_Address::get_value_entry_detail()