search-filter icon indicating copy to clipboard operation
search-filter copied to clipboard

empty_search_url doesn't work when post_types is specified

Open marcfon opened this issue 4 years ago • 1 comments

As the post_types parameter always adds the value to the URL the empty_search_url is never called.

Changing line 1072 to this fixed the issue for me. if($this->urlparams=="/?s=" || $this->urlparams=="/?s=&post_types=" . $post_types)

Not sure though if this will work when you have multiple post types specified.

marcfon avatar Mar 11 '20 15:03 marcfon

Ran into this same issue. In my case, the taxonomies I'm filtering on are only enabled on the custom post type I'm searching so I can get by without using the post_types parameter but otherwise I would need to make the above change to get things to work.

emont88 avatar Dec 04 '20 02:12 emont88