I have a query object, where both tax_query
and p
parameters are set
[query] => Array
(
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => destination_tag
[field] => slug
[terms] => Array
(
[0] => country
)
)
)
[post_type] => dc-location
[lang] => en
[posts_per_page] => 10
[paged] => 1
[p] => 7
)
The resulting SQL query ignores the tax_query parameter
[request] => SELECT wptests_posts.* FROM wptests_posts WHERE 1=1 AND wptests_posts.ID = 7 AND wptests_posts.post_type = 'dc-location' ORDER BY wptests_posts.post_date DESC
If I remove the p
parameter, the query includes the tax query correctly. Is there a way to force the sql to parse tax_query
even if p
is defined?
post__in
instead ofp
? Why are you trying to combine them anyway? What's your goal?post_in
works as expected, put the comment as an answer and I will accept it, I will open a track ticket on WP to understand if this is the desired behavior, it should at least be documented