[wp-trac] [WordPress Trac] #12891: Advanced multi-taxonomy WP_Query()s

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 8 01:14:19 UTC 2010


#12891: Advanced multi-taxonomy WP_Query()s
-----------------------------+----------------------------------------------
 Reporter:  markjaquith      |        Owner:  markjaquith
     Type:  task (blessed)   |       Status:  closed     
 Priority:  normal           |    Milestone:  3.1        
Component:  Query            |      Version:  3.0.1      
 Severity:  normal           |   Resolution:  fixed      
 Keywords:  ongoing-project  |  
-----------------------------+----------------------------------------------

Comment(by Otto42):

 Replying to [comment:178 mikeschinkel]:
 > This support "`x AND y`" and "`x OR  y`" but not "`x AND (y OR z)`" and
 not "`x AND y AND NOT z`" right?

 Actually it can support all of the above, with caveats.

 X AND Y and X OR Y is obviously possible for all cases.

 X AND Y AND NOT Z is possible, as you can set the operator parameter to
 NOT IN for a single taxonomy.

 X AND (Y OR Z) is possible for the special case of Y and Z being both
 terms in the same taxonomy. The "terms" parameter uses an operator of "IN"
 by default, so it would really be like "cat=X and tag IN (Y,Z)", which is
 basically equivalent.

 See http://otto42.com/81 for detailed usage info, and some examples.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12891#comment:179>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list