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

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 31 16:29:12 GMT 2008


#7431: Allow posts to be ordered by meta_key
-------------------------------------+--------------------------------------
 Reporter:  AaronCampbell            |        Owner:  anonymous
     Type:  defect                   |       Status:  new      
 Priority:  high                     |    Milestone:  2.7      
Component:  General                  |      Version:           
 Severity:  normal                   |   Resolution:           
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Comment (by AaronCampbell):

 And westi, it's not quite as simple as using posts_orderby.  That filter
 passes you $q['orderby'], but not until after it has been cleaned (forced
 to be only 'author', 'date', 'category', 'title', 'modified',
 'menu_order', 'parent', 'ID', or 'rand') and turned into an SQL order by
 statement, which means you can't tell what the user originally requested
 so you don't know whether they wanted to order by meta_value or not.

 At least, I don't see any good way to find out what the user actually
 requested.

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


More information about the wp-trac mailing list