10up / ElasticPress

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

Fix search terms clearing post type filter from forms. #3891

Closed JakePT closed 5 months ago

JakePT commented 5 months ago

Description of the Change

Fixes an issue where the default post type that is set from an <input name="post_type"> field in the search form would be cleared if a new search term was entered.

Note that this is only true when the Post Type facet/filter is not in use. If the post type facet is enabled, it will be cleared as before. This is the expected behaviour for filters.

Closes #3868

How to test the Change

Changelog Entry

Fixed - An issue in Instant Results where a default post type filter that is set by a field in the search form would be cleared if a new search term was entered.

Credits

Props @JakePT @burhandodhy

Checklist: