[wp-trac] [WordPress Trac] #41287: Add AND query mode for taxonomy terms

WordPress Trac noreply at wordpress.org
Wed May 26 02:16:07 UTC 2021


#41287: Add AND query mode for taxonomy terms
-------------------------------------------------+-------------------------
 Reporter:  sebbb                                |       Owner:  dlh
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.8
Component:  REST API                             |     Version:  4.8
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  dev-feedback has-patch has-unit-     |     Focuses:
  tests commit                                   |
-------------------------------------------------+-------------------------
Changes (by TimothyBlynJacobs):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51026" 51026]:
 {{{
 #!CommitTicketReference repository="" revision="51026"
 REST API: Add support for modifying the term relation when querying posts.

 By default, a post most contain any of the requested terms to be included
 in the response. This commit adds a new `operator` property that can be
 set to `AND` to require a post to contain all of the requested terms.

 For example, `/wp/v2/posts?tags[terms]=1,2,3&tags[operator]=AND` will
 return posts that have tags with the ids of 1, 2, and 3.

 Props dlh, earnjam, Clorith, jnylen0, sebbb.
 Fixes #41287.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41287#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list