[wp-trac] [WordPress Trac] #32443: Upload iframe renders pictures in reverse order

WordPress Trac noreply at wordpress.org
Tue May 19 18:49:58 UTC 2015


#32443: Upload iframe renders pictures in reverse order
----------------------------+-----------------------------
 Reporter:  sapegin         |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  4.2.2
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 Attachments are in reverse order when they have menu_order attributes.

 It is because this code in get_media_items function:

 {{{
 $attachments = get_children( array( 'post_parent' => $post_id, 'post_type'
 => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') );
 }}}

 Generates this query:

 {{{
 …wp_posts.menu_order DESC, wp_posts.ID DESC…
 }}}

 It should be:


 {{{
 $attachments = get_children( array( 'post_parent' => $post_id, 'post_type'
 => 'attachment', 'orderby' => array( 'menu_order' => 'ASC', 'ID' =>
 'DESC') ) );
 }}}

 Which will generate:

 {{{
 …wp_posts.menu_order ASC, wp_posts.ID DESC…
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32443>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list