-
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
BUG: Using post_tag in query is setting the slug param in a wrong format #2310
Comments
If that helps to speed-up the debug process, I created a gist having a site export xml file and part of the code I'm using: |
Hey @pabamato did
work for you? When I tested this I got a 400 with this error:
This seems to be because of bad formatting from the plugin. I just want to check if it is something that recently broke. From the WP_Query docs you linked https://developer.wordpress.org/reference/classes/wp_query/#tag-parameters it seems that the correct param is "tag" right? so something like this:
Using |
Once merged #2341 should address the identified problems. |
Describe the bug
From the WP_Query docs, if you use slugs as the matching param, you can pass params in two formats:
On https://github.com/10up/ElasticPress/blob/trunk/includes/classes/Indexable/Post/Post.php#L844,
The params gets converted to an array, so looks like you can not query for multiple values.
Same wrong format on https://github.com/10up/ElasticPress/blob/trunk/includes/classes/Indexable/Post/Post.php#L852
Also, looks like this is being added with the correct format later on https://github.com/10up/ElasticPress/blob/trunk/includes/classes/Indexable/Post/Post.php#L906
'post_tag' is the query_var for that particular taxonomy
Steps to Reproduce
Query posts passing multiple post_tags:
Having a site with 2 posts(post1, post2) and 2 terms in post_tags(slug1,slug2):
post1 ->slug1
post2 ->slug2
Expected behavior
Both queries should return 2 posts since it should match posts having either slug1 or slug2.
Screenshots
Environment information
Site Health Info:
Additional context
The text was updated successfully, but these errors were encountered: