-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/post type enhancements #1689
Conversation
fa6c668
to
9ef4606
Compare
I have update the PR so that the JavaScript changes to autosuggest have been applied to an up to date version of that script, and don't use jQuery. I also updated the JavaScript to support different possible post type inputs in the search form, including:
All of those are possible with searchform.php, so this version ensures that the autosuggest behaviour matches the behaviour of submitting the form. I used a couple This probably also addresses #2135. |
@JakePT can you let me know how the post type feature is planned to work? I was thinking it should add a post type support in the facet widget but seems it is not the case. |
It just limits autosuggest results to whichever post type is being searched by the search form. The main example is WooCommerce, which uses a hidden |
Let's please adjust the |
Done @felipeelia |
Description of the Change
This PR tries to address two problems, related to
post_type
support.In order to restrict the autosuggest query by post_type. I have added a control that checks
[name="post_type"]
input and applying particularpost_type
to query. Therefore, we can show only the "products" for WooCommerce's own search bar.I have changed facet's query build logic a bit, now
ep_facet_allowed_query_args
allows to extend allowed query parameters.post_type
ands
are supported by default.Alternate Designs
Benefits
Improving
post_type
support without adding custom codePossible Drawbacks
Verification Process
[Autosuggest]
/shop/
page[Facets]
post_type
on the target urlScreenshot
(first input Woo's search, second is generic)
Checklist:
Applicable Issues
#1687, #1684
Changelog Entry
[name="post_type"]
input in the same form.ep_facet_allowed_query_args
for facets