-
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
Remove duplicate category_name, cat and tag_id from ES query when tax_query set #2241
Conversation
Hi @rebeccahum, it seems one of the unit tests failed. Do you mind taking a look? Thanks! |
@felipeelia Hiya! I've fixed the failing test now, can you please approve the running workflow? |
Thank you very much @rebeccahum! I've approved the workflow again. It looks like #2242 is related to the bug you are solving here but there seems to be yet another problem directly related to it. Just out of curiosity, is that by any chance something you are also facing? |
@felipeelia I was able to reproduce that additional bug in regards to the |
Thanks for this @rebeccahum! |
* Fix tag__and in use with tag_id * 1:1 with upstream patch 10up#2241 * Fix syntax error
Description of the Change
Fixes #1896. Core has a funky backwards compat feature where category_name, cat and tag_id are explicitly set: https://github.com/WordPress/WordPress/blob/5d99107bf3ab35aa3dda82c6b3903f5717771335/wp-includes/class-wp-query.php#L2193-L2215. However, this is interfering with the ES query when tax_query is set by creating duplicate filters from it.
Alternate Designs
I didn't consider any alternative designs since this was previously patched in and wanted to follow a similar pattern to #501. However, the patch was overwritten via #1617.
Benefits
No more duplicate filters in the ES query!
Possible Drawbacks
N/A
Verification Process
You'll observe the duplicate filters applied here:
Checklist:
Applicable Issues
#1896
Changelog Entry
Fixed duplicate category or tag filters when tax_query is set.