Hi,
I am sorry for the delay. Do you still have this issue?
Thanks
Hi,
Yea this is still a problem that I am having.
Thanks
Hi,
So you want to disable the feature of WPES while your custom query is running? Is it?
Thanks
Hello,
Sorry what I am trying to do is use WPES but allow it to respect my settings within the WQ_Query I am running… I want to run WPES on only certain Custom Post Types… not bring back results for ‘all’ Custom Post Types.
Hi,
Thanks for letting me know.
Currently, WPES settings are global and effect every search query either primary from WP or user query.
If I remove the overriding for secondary query then some users may complain that WPES settings are not effective for secondary query.
I am planning a new feature to solve this problem. Meanwhile, WPES adding a pre_get_posts hook to alter the post type. I know this is not a good approach but you can add your pre_get_posts hook to override WPES settings.
The hook is added here https://plugins.trac.wordpress.org/browser/wp-extended-search/trunk/includes/WP_ES.php#L87 you have to run it later than WPES hook.
PS: Please check that it is your custom query in pre_get_posts hook.
If you need any help in that. Please let me know.
Thanks
I was able to solve the problem by adding a check to see if the query_vars contains post_type.
public function wp_es_pre_get_posts($query) {
if (!empty($query->is_search) && !$this->is_bbPress_search()) {
if (!isset($query->query_vars['post_type']) && !empty($this->WP_ES_settings['post_types'])) {