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

WordPress Trac wp-trac at lists.automattic.com
Mon Jan 24 23:35:06 UTC 2011


#15388: get_posts does not order by menu_order
------------------------------------------+-----------------------
 Reporter:  ggus                          |       Owner:
     Type:  defect (bug)                  |      Status:  reopened
 Priority:  normal                        |   Milestone:
Component:  Query                         |     Version:  3.0.4
 Severity:  normal                        |  Resolution:
 Keywords:  menu_order get_posts orderby  |
------------------------------------------+-----------------------
Changes (by F J Kaiser):

 * status:  closed => reopened
 * version:  3.0.1 => 3.0.4
 * resolution:  worksforme =>


Comment:

 I got the same issue as "ggus" (reporter):


 {{{
 query_posts( array( 'post_type' => 'whatever', 'post_status' => 'publish',
 '''order_by' => 'menu_order''', 'order' => 'DESC' ) );
 }}}

 produces:

 {{{
 SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND
 wp_posts.post_type = 'whatever' AND (wp_posts.post_status = 'publish')
 ''ORDER BY wp_posts.post_date'' DESC LIMIT 0, 10
 }}}

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


More information about the wp-trac mailing list