10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.23k stars 312 forks source link

BUG: "Exclude from search results" doesn't work in the AJAX callback function #3911

Open burhandodhy opened 2 months ago

burhandodhy commented 2 months ago

Describe the bug

When querying the posts in the AJAX callback function, ElasticPress retrieves the post regardless of whether the 'Exclude from search results' option is enabled for that post.

Steps to Reproduce

  1. Create a post titled "Exclude me".
  2. Check the "Exclude from search results" option.
  3. Enable ElasticPress AJAX integration by adding this filter add_filter( 'ep_ajax_wp_query_integration', '__return_true' );
  4. Write an AJAX callback function to search for that post.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct