[wp-trac] [WordPress Trac] #7431: Allow posts to be ordered by meta_key

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 29 18:23:15 GMT 2008

#7431: Allow posts to be ordered by meta_key
 Reporter:  AaronCampbell  |       Owner:  anonymous              
     Type:  defect         |      Status:  new                    
 Priority:  high           |   Milestone:  2.6.1                  
Component:  General        |     Version:                         
 Severity:  normal         |    Keywords:  has-patch needs-testing
 You can specify a meta_key and meta_value when you are getting
 posts/pages, but you can't then sort those posts by that key.  It seems
 like this is a common need.  It's a relatively simple patch, so here it

 This will work with this patch:
 $args = array(
         'meta_key'      => 'wpo_feedid',
         'orderby'       => 'wpo_feedid'
 $myQuery = new WP_Query();

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

More information about the wp-trac mailing list