Autocomplete legacy filter

bh_sl_autocomplete_legacy

Description

Forces address suggestions to use Google’s legacy Places Autocomplete widget instead of Places API (New).

Since version 1.12.0, Cardinal Locator uses Places API (New) for address suggestions when it’s enabled for your Google Maps API key, and automatically falls back to the legacy widget when it isn’t. Use this filter to always use the legacy widget, for example if you’ve written custom CSS or JavaScript for it.

The filter receives and returns a boolean. The default is false. Address suggestions also need to be turned on under Settings → Cardinal Locator → Primary Settings → Google Places autocomplete.

Note: Google no longer offers the legacy Places API to new customers, so this only works with API keys that already have it. The Check API key button under Primary Settings shows which Places APIs your key can use.

Example

Always use the legacy Places Autocomplete widget:

add_filter( 'bh_sl_autocomplete_legacy', '__return_true' );

Added in version 1.12.0.

Last updated

· Suggest an edit