Gform address display format

Description

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

Usage

<?php
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


<?php

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

?>

Source Code

This filter is located in common.php

Search the Documentation