[wp-trac] [WordPress Trac] #38034: post__in orderby not working when passed in an array to orderby

WordPress Trac noreply at wordpress.org
Mon Mar 6 21:10:32 UTC 2017


#38034: post__in orderby not working when passed in an array to orderby
-------------------------------+------------------------------
 Reporter:  kelvink            |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  4.6
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by AllysonSouza):

 I'm also having this problem, ordeby `post__in` not work even in string.
 That's my code:

 {{{#!php
 <?php
     $membros = array( 156, 159, 153 );
     $args = array(
         'post_type'      => 'time',
         'posts_per_page' => -1,
         'post__in'       => $membros,
         'orderby'        => 'post__in',
     );
 ?>
 }}}

 The posts are displayed in the default admin list order, ignoring the
 `post__in`.

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


More information about the wp-trac mailing list