[wp-trac] [WordPress Trac] #25647: [WP_Query] Include post_type_query parameter to WP_Query

WordPress Trac noreply at wordpress.org
Mon Oct 21 11:41:44 UTC 2013


#25647: [WP_Query] Include post_type_query parameter to WP_Query
--------------------------+-----------------------------
 Reporter:  alexvorn2     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 My idea is to include a new parameter to WP_Query function that will be
 something like this:


 {{{
 $args = array(
         'post_type_query' => array(
                 array(
                         'post_type' => 'post',
                         'tax_query' => array(
                                 array(
                                         'taxonomy' => 'people',
                                         'field' => 'slug',
                                         'terms' => 'bob'
                                 )
                         )
                 ),
                 array(
                         'post_type' => 'book',
                         'tax_query' => array(
                                 array(
                                         'taxonomy' => 'genre',
                                         'field' => 'slug',
                                         'terms' => 'comedy'
                                 )
                         )
                 ),
                 array(
                         'post_type' => 'movie',
                         'tax_query' => array(
                                 array(
                                         'taxonomy' => 'genre',
                                         'field' => 'slug',
                                         'terms' => 'comedy'
                                 )
                         )
                 )
         )
 );
 $query = new WP_Query( $args );
 }}}

 This will help to show multiple post types with specific taxonomies and
 terms without being in a conflict with each other...

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25647>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list