[wp-trac] [WordPress Trac] #28012: orderby post__in interferes with menu_order

WordPress Trac noreply at wordpress.org
Sun May 11 03:33:14 UTC 2014


#28012: orderby post__in interferes with menu_order
------------------------------------------+------------------
 Reporter:  Matthias82                    |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  4.0
Component:  Query                         |     Version:  3.9
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+------------------

Comment (by lukecarbis):

 I've tested this on 1.3.9 and 1.4.0, and I can't reproduce the problem on
 either.

 Here's what I tried:

 {{{
 $query_pages = array( 4, 6, 8, 2 );

 $pages = new WP_Query(
         array(
                 'posts_per_page' => count( $query_pages ),
                 'post_type'      => 'page',
                 'post__in'       => $query_pages,
             'orderby'        => 'post__in',
         )
 );

 echo '<ul>';
 foreach( $pages->posts as $page ) {
     echo '<li>Page ID: ' . $page->ID . ' - Order: ' . $page->menu_order .
 '</li>';
 }
 echo '</ul>';
 }}}

 Here's the expected ''and'' generated output:

 {{{
 Page ID: 4 - Order: 22
 Page ID: 6 - Order: 0
 Page ID: 8 - Order: 0
 Page ID: 2 - Order: 4
 }}}

 Can you try to reproduce this problem on a new clean install?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28012#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list