Menu

Gravity Forms Address Enhanced

Gravity Forms Address Enhanced

Extend the Gravity Forms address field, with better WooCommerce integration.

Functions

Developers may at times need to directly interact with this plugin to achieve their goals. Here are some useful functions that can help. Note that all functions are namespaced, so you will need to import them at the start of your PHP file, like this:

use webaware\gf_address_enhanced\get_country_name;

  1. get_country_name

    • string $country_code
    • return string

    Attempt to convert a country code to a country name.

  2. get_state_code_as_iso_3166_2

    • string $state_code
    • string $country_code
    • return string
    • throws CountryException

    Convert a short state code for a country into a full ISO-3166-2 state code.

  3. get_state_code_as_name

    • string $state_code
    • string $country_code
    • return string
    • throws CountryException

    Convert a short state code for a country into its name.

     

  4. get_state_code_as_woocommerce

    • string $state_code
    • string $country_code
    • return string
    • throws CountryException

    Convert a short state code for a country into a WooCommerce-compatible state code.