[wp-trac] [WordPress Trac] #4065: useful function: merge_wp_queries()

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 1 06:58:45 GMT 2007


#4065: useful function: merge_wp_queries()
----------------------------+-----------------------------------------------
 Reporter:  markjaquith     |       Owner:  anonymous  
     Type:  task            |      Status:  new        
 Priority:  low             |   Milestone:  2.4        
Component:  Administration  |     Version:             
 Severity:  normal          |    Keywords:  needs-patch
----------------------------+-----------------------------------------------
 It would be really handy if you could take two WP_Query objects and merge
 them.  Duplicate posts would be removed, and you could choose a sort
 column and sort order.

 Example usage:

 {{{
 $q1 = new WP_Query('monthnum=12&year=2006');
 $q2 = new WP_Query('monthnum=1&year=2007');
 $merged = merge_wp_queries($q1, $q2, 'post_date_gmt', 'desc');
 }}}

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


More information about the wp-trac mailing list