Opened 11 years ago
Last modified 7 years ago
#32443 new defect (bug)
Upload iframe renders pictures in reverse order
| Reported by: | sapegin | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Media | Version: | 4.2.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | administration |
Description
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…
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Previously: #16584