Back to list of all filter and action hooks for Google Address Autocomplete.
Description #
Modify the URL parameters for the Google Places API script.
Parameters #
$parameters
(array) The Google Maps API URL parameters array containing. Below are the default parameters used by our plugin, but any URL parameter accepted by the Google Maps Javascript API can be used.key
(string) Google Maps API key for authentication.libraries
(string) Comma-separated list of Google Maps libraries to load (Always includes'places'
).language
(string) Language code for API responses (e.g.,'en'
,'es'
,'fr'
).region
(string) Region code for result bias (e.g.,'US'
,'GB'
,'CA'
).
Examples #
/**
* Force address suggestion result bias to US.
*/
function add_custom_api_parameter( $parameters ) {
$parameters['region'] = 'US';
return $parameters;
}
add_filter( 'fc_gaa_google_places_api_url_parameters', 'add_custom_api_parameter' , 10);