‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
is_search() is only true if the main query is for the search results. When you create your own query with new WP_Query, you’re not using the main query. Additionally, AJAX requests do not even have a main query, so functions like is_search(), is_archive() etc. do not work. If you want to check if a specific … Read more