wpsl_autocomplete_options

  1. Description
  2. Parameters
  3. Usage
  4. Changelog
  5. Source File

Description

This filter allows you to overwrite the settings that are used to make requests to the Places API.

By default only the ‘geometry.location’ data is requested, but with this filter you can include additional data in the returned results, or set additional options that are used when a new autocomplete request is made.

Parameters

$settings - (array) The default autocomplete restrictions.

Usage

This code shows how to restrict the autocomplete results to establishments only.

Other fields that you can set are listed here.

Changelog

Since 2.2.20

Source File

This filter is located in /frontend/class-frontend.php

Placement

The code needs to be placed in the functions.php file inside your active theme folder.