Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Autosuggest filters to proper WordPress hooks #2983

Merged
merged 7 commits into from
Sep 22, 2022
Merged

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Sep 5, 2022

Description of the Change

Migrates the custom 'filter' functions in Autosuggest to use proper WordPress hooks. Existing uses of filter functions are applied as callbacks to the new hooks from a back-compat file.

Closes #2961

How to test the Change

  • Add the example code from the existing documentation and confirm they still behave as expected.
  • Replace the code with the example code from the updated documentation and confirm the result still matches what is described.

Changelog Entry

  • Added ep.Autosuggest.itemHTML, ep.Autosuggest.listHTML, ep.Autosuggest.query, and ep.Autosuggest.element JavaScript hooks to Autosuggest and migrated filter functions to hook callbacks for backwards compatibility.

Credits

Props @JakePT

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@JakePT JakePT added needs documentation module:autosuggest Issues related to the Autosuggest functionality labels Sep 5, 2022
@JakePT JakePT added this to the 4.4.0 milestone Sep 5, 2022
@JakePT JakePT self-assigned this Sep 5, 2022
@JakePT JakePT changed the title Migrate Autosuggest filters to proper WordPress hooks WIP: Migrate Autosuggest filters to proper WordPress hooks Sep 6, 2022
@JakePT JakePT marked this pull request as ready for review September 13, 2022 08:52
@JakePT JakePT changed the title WIP: Migrate Autosuggest filters to proper WordPress hooks Migrate Autosuggest filters to proper WordPress hooks Sep 13, 2022
assets/js/autosuggest/index.js Outdated Show resolved Hide resolved
@felipeelia felipeelia modified the milestones: 4.4.0, 4.3.1 Sep 16, 2022
@felipeelia felipeelia merged commit bf32b81 into develop Sep 22, 2022
@felipeelia felipeelia deleted the feature/2961 branch September 22, 2022 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:autosuggest Issues related to the Autosuggest functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate Autosuggest filters to proper WordPress hooks
3 participants