If you’re familiar with PHP, then this filter will help you do what you want.
Thank you!
I have no idea about PHP but I will try and learn.
Best regards,
Georg
Just copy the code from usage section from the link that I posted, place it in the functions.php inside your theme folder, and try to change this
$geocode_components['administrativeArea'] = 'Illinois';
into this.
$geocode_components['administrativeArea'] = 'Berlin';
You do need to make sure the “Restrict the geocoding results to the selected map region?” option is enabled on the WPSL settings page, and in this case set to “Germany”.
Oh, no.
The filter works great but now Google autocomplete stops working.
That shouldn’t break it. I will take a look at what’s going on in the code tomorrow.
Sorry for the late response, I did replicate the issue. But haven’t really had time to figure out why it breaks.
Ok. Please keep me posted if you figure out how to fix it.
As far as I see the Google autocomplete also does not work with the widget. But this is not caused by the filter. I guess there is no autocomplete for the widget at the moment?
No, the widget doesn’t have autocomplete support at the moment.
Do you plan to add the Google autocomplete feature within the next 5 weeks?
Not at the moment, I’m first planning to finish work on the directory and statistics add-on before continuing working on the main WPSL plugin and improving the existing add-ons. I will also be going on a holiday for a few weeks, so other then support, very little work will happen.
I did find the exact problem why autocomplete breaks.
The way the normal search is limited to country x is by settings the componentRestrictions. This supports limiting it to a administrativeArea ( the city ).
Those same values are used to limit the autocomplete results, but the componentRestrictions used with the autocomplete only support restricting it by country, and including more data ( like the administrativeArea ) clearly breaks it.
I will release a fix for this soon.
What exact state / city are all your locations in?
Sorry for not responding before, but what you want doesn’t seem to be possible after all with autocomplete.
From the autocomplete documentation.
componentRestrictions can be used to restrict results to specific groups. Currently, you can use componentRestrictions to filter by country.
.
I tested several other options, but just restricting the autocomplete results to cities never worked for me.