rmorse / search-filter

Search & Filter is a simple search and filtering plugin for WordPress
GNU General Public License v2.0
93 stars 41 forks source link

empty_search_url doesn't work when post_types is specified #61

Open marcfon opened 4 years ago

marcfon commented 4 years ago

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.

emont88 commented 4 years ago

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.