[wp-trac] [WordPress Trac] #15068: merging query objects/arrays

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 8 04:27:58 UTC 2010


#15068: merging query objects/arrays
----------------------------+-----------------------------------------------
 Reporter:  youngmicroserf  |       Owner:                 
     Type:  enhancement     |      Status:  new            
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Query           |     Version:  3.0.1          
 Severity:  normal          |    Keywords:                 
----------------------------+-----------------------------------------------
 As multiple post type installations proliferate, I assume more and more
 people will come across a situation (like me) in which they need to
 display two (or more) sets of content units, say posts, and post-type
 "audio" in one stream - say on the main blog page. As long as the only
 condition is the post type itself, that will work fine. However, if those
 two sets need to be selected using different conditional criteria, say a
 category in one case, and a custom field in the other, then the current
 query_posts options will not be sufficient.

 While it is possible to retrieve multiple arrays via get_posts and merge
 them, then sort them using cusomt php, such a solution will break the
 paged navigation.

 If such situations will - as I assume - become more likely as more people
 use multiple post types and additional variables to specify content, I
 think it would be useful to be able to combine multiple queries into a
 meta query that will sort the combined object according to a common
 sorting variable, say date, and thus preserve the paged navigation.

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


More information about the wp-trac mailing list