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

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 6 18:36:54 UTC 2010


#12891: Advanced multi-taxonomy WP_Query()s
----------------------------+-----------------------------------------------
 Reporter:  markjaquith     |       Owner:  markjaquith         
     Type:  task (blessed)  |      Status:  assigned            
 Priority:  normal          |   Milestone:  3.1                 
Component:  Query           |     Version:  3.0.1               
 Severity:  normal          |    Keywords:  taxonomies has-patch
----------------------------+-----------------------------------------------

Comment(by scribu):

 So, simple usage:

 {{{
 query_posts( array(
   'tag' => 'foobar',
   'color' => 'green'
 ) );
 }}}

 Advanced usage:

 {{{
 query_posts( array(
   'taxonomy_query' => array(
     'taxonomy' => 'post_tag',
     'terms' => array( 'foobar' ),
   ), array(
     'taxonomy' => 'color',
     'terms' => array( 'green', 'white' ),
     'operator' => 'AND'
   )
 ) );
 }}}

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


More information about the wp-trac mailing list