Filter hooks

Developers can customise the behaviour of the plugin through filter hooks. There are some useful filter hooks supported by this plugin, and by Gravity Forms itself.

  • gf_address_enhanced_countries

    • array $countries
    • return array

    Developers can change the map of country names to codes.

  • gf_address_enhanced_country_file

    • string $filepath
    • string $country_code
    • return string

    Developers can add their own country and state/province definitions, overriding those provided in the plugin. See the folder includes/countries/ for examples.

  • gf_address_enhanced_label_subdivisions_default

    • string $default_label
    • return string

    Developers can change the default label on state/province subfields.

  • gf_address_enhanced_layout

    • string $layout
    • int $form_id
    • GF_Field $field

    Developers can change the Address field layout to put the country subfield first, by returning ‘country_top’ from this filter. Supports hooking for all forms, by form ID, and by form ID and field ID per Gravity Forms conventions.

  • gf_address_enhanced_smart_states_countries

    • array $countries
    • return array

    Developers can add or remove countries that should be supported for Smart States dropdowns.