Post api filter with tags

Question

I have two tags one with id 16 and the other one id 18

I would like to query the posts having the tag 16 AND 18

wp-json/wp/v2/posts?tags=16,18 is returning 16 OR 18

wp-json/wp/v2/posts?tags=16,18&tax_relation=AND is returning 16 OR 18

wp-json/wp/v2/posts?tags=16&tags=18 I have less posts but I can found for example posts with tags 18 and 17 in the result

Let’s say I have 3 posts

  • post1, tags [16, 18]
  • post2, tags [17, 18]
  • post2, tags [17, 19]

I want to be able to have posts with only tags 16 AND 18 but if the array of tags contains 17 it should not be returned

0
Ajouve 2 years 2020-12-29T03:10:21-05:00 0 Answers 2 views 0

Leave an answer

Browse
Browse