fc_gaa_brasil_api_autocomplete_js_settings

Back to list of all filter and action hooks for Google Address Autocomplete.

Description #

Modify the Brasil API integration settings for address autocomplete functionality.

Parameters #

  • $settings (array) The Brasil API settings array containing:
    • debugMode (bool) Whether debug mode is enabled
    • brasilApiURL (string) The Brasil API URL template for CEP lookup
    • localeComponents(array) Field mapping for address components. The array key is the address field ID on the checkout form, and the array value is the field ID on the data returned by the API:
      • state (string) State field ID from the returned data.
      • city (string) City field ID from the returned data.
      • address_1 (string) Street address field ID from the returned data.
      • neighborhood (string) Neighborhood field ID from the returned data.

Examples #

/**
 * Modify Brasil API settings field mappings.
 */
function modify_brasil_api_settings( $settings ) {
    // Field mappings
    $settings['localeComponents'] = array(
        'state'        => 'state',
        'city'         => 'city',
        'address_1'    => 'street',
        'neighborhood' => 'neighborhood',
    );

    return $settings;
}
add_filter( 'fc_gaa_brasil_api_autocomplete_js_settings', 'modify_brasil_api_settings', 10 );

What are your feelings

Updated on December 15, 2025