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

filter to add autosuggest styles while indexing #2842

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

hugosolar
Copy link

Description of the Change

The filter ep_autosuggest_styles_if_idexing should allow enqueueing autosuggest styles even if the website is being reindexed.
We have a project where we rely on those styles on the frontend but we're not relying on the ElasticPress built-in endpoint for autosuggest so not having those styles break the site appearance

Closes #2841

Alternate Designs

For now, we add a fix at the theme level where we're enqueuing the styles if are not enqueued but I think it could be helpful to force the styles if it's needed using a filter

Possible Drawbacks

since this change was introduced as a fix to a JS error, there are no possible side-effects since are just the styles

Verification Process

Fork the project and test my branch in my local environment. Ran a full site reindex and then test the filter is working properly

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Added - ep_autosuggest_styles_if_idexing filter to enqueue autosuggest styles even if index is running

Credits

Props @hugosolar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add filter to enqueue autosuggest styles when reindexing
1 participant