[wp-trac] [WordPress Trac] #15388: get_posts does not order by menu_order

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 13 06:40:33 UTC 2011


#15388: get_posts does not order by menu_order
------------------------------------------+------------------------------
 Reporter:  ggus                          |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Query                         |     Version:  3.0.1
 Severity:  normal                        |  Resolution:
 Keywords:  menu_order get_posts orderby  |
------------------------------------------+------------------------------

Comment (by ryan):

 This request:

 {{{
 get_posts('post_type=page&orderby=menu_order&order=DESC');
 }}}

 Produces this query:

 {{{
 SELECT wp_trunk_posts.* FROM wp_trunk_posts WHERE 1=1 AND
 wp_trunk_posts.post_type = 'page' AND (wp_trunk_posts.post_status =
 'publish') ORDER BY menu_order ASC LIMIT 0, 5
 }}}

 menu_order is properly represented in the query and the pages are ordered
 as expected. That case statement is unnecessary but doesn't seem to hurt
 anything.  Further, the Pages admin screen does orderby='menu_order title'
 just fine.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15388#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list