Hi all, I’m have the GeoLocation addon and working via Google Places API, I’m trying to limit address to South Africa only.
- I’m Using Garvity forms Version 2.9.9
- Geolocation by Gravity Forms - 1.5.0
- Divi Builder
I have inserted the following code into the functions.php file right at the bottom. But it still is not working. Any pointer or advice will be appreciated.
function limit_autocomplete_to_south_africa( $options, $form_id ) {
if ( $form_id == 8 ) {
$options[‘componentRestrictions’] = array( ‘country’ => ‘za’ );
}
return $options;
}
add_filter( ‘gform_geolocation_place_autocomplete_options’, ‘limit_autocomplete_to_south_africa’, 10, 2 );