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

Utility function for checking if a request should be integrated. #2267

Merged
merged 11 commits into from
Aug 23, 2021

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Jul 14, 2021

Description of the Change

Updates all checks for ElasticPress and feature integration to use a utility function that properly and centrally accounts for admin and AJAX requests. Addresses #2148.

Benefits

Uses a single utility function for determining whether ElasticPress or features should be integrated for each request, ensuring consistency with whether integration is enabled for certain features.

Verification Process

Features should be active on queries under the following conditions:

Default behaviour:

Feature Public REST API Admin admin-ajax.php
Search
Highlighting
Weighting
Documents
Protected Content
WooCoommerce

When ep_admin_wp_query_integration is true:

Feature Public REST API Admin admin-ajax.php
Search
Highlighting
Weighting
Documents
Protected Content
WooCoommerce

When ep_ajax_wp_query_integration is true:

Feature Public REST API Admin admin-ajax.php
Search
Highlighting
Weighting
Documents
Protected Content
WooCoommerce

Or when both filters are true:

Feature Public REST API Admin admin-ajax.php
Search
Highlighting
Weighting
Documents
Protected Content
WooCoommerce

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.

Applicable Issues

#2148

Changelog Entry

WIP

@JakePT
Copy link
Contributor Author

JakePT commented Aug 16, 2021

@felipeelia @brandwaffle This has been updated with a new @ since version and the feature is passed as a "context" parameter that can be used in filters. I'd still like a second pair of eyes to test thoroughly.

@JakePT JakePT marked this pull request as ready for review August 19, 2021 12:14
@felipeelia felipeelia merged commit 71df5a9 into develop Aug 23, 2021
@felipeelia felipeelia deleted the fix/2148 branch August 23, 2021 20:37
felipeelia added a commit that referenced this pull request Aug 23, 2021
@felipeelia felipeelia mentioned this pull request Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants