[wp-trac] [WordPress Trac] #10649: Meta_key sort for numeric values / Natural Sort Order

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 19 13:40:42 UTC 2009


#10649: Meta_key sort for numeric values / Natural Sort Order
-------------------------+--------------------------------------------------
 Reporter:  stencil      |       Owner:  ryan          
     Type:  enhancement  |      Status:  new           
 Priority:  normal       |   Milestone:  Future Release
Component:  Query        |     Version:  2.8.4         
 Severity:  normal       |    Keywords:                
-------------------------+--------------------------------------------------
 When trying to sort posts by meta_key with numeric values the order is not
 "natural".

 eg:  1, 10, 2, 3, 4, 5, 6, 7, 8, 9

 This should be

 eg: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

 I have attached a simple addition to wp-includes/query.php which allows
 for this type of sorting.

 Query use: orderby=meta_value_num

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


More information about the wp-trac mailing list