Skip to content

Conversation

@ZacharyRener
Copy link
Collaborator

@ZacharyRener ZacharyRener commented May 21, 2025

Description of the Change

New Feature: Autosuggest V2
This uses the Post Search API and filterable React components. By default it matches the appearance of Autosuggest V1:

Available PHP hooks:

  • ep_autosuggest_v2_per_page - Modify count of results returned

Available JS hooks:

  • ep.Autosuggest.queryParams - Modify search query parameters
  • ep.Autosuggest.suggestions - Filter search results
  • ep.Autosuggest.suggestionItem - Customize individual suggestion item rendering
  • ep.Autosuggest.suggestionList - Customize suggestion list rendering
  • ep.Autosuggest.onItemClick - Triggered when a suggestion item is clicked

Available Events:

  • ep_autosuggest_loaded - window.EPAutosuggest is available - safe to hook into ui overrides

More information on the hooks is available in the autosuggest-v2 readme

Here's the result of some child theme hook customizations:

How to test the Change

  • Enable the feature in ElasticPress
  • Confirm the appearance is identical to Autosuggest V1
  • (If desired) In your theme or from another plugin, add and test out some hooks. Reference autosuggest-v2's readme.md for premade hooks.

Changelog Entry

Added - New feature: Autosuggest V2

Credits

Props @ZacharyRener

Checklist:

@ZacharyRener ZacharyRener added the new feature Label for new, potentially bigger features label May 21, 2025
@ZacharyRener ZacharyRener added this to the 5.3.0 milestone May 21, 2025
@ZacharyRener ZacharyRener marked this pull request as ready for review May 28, 2025 13:03
@felipeelia felipeelia modified the milestones: 5.3.0, 5.4.0 Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Label for new, potentially bigger features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants