Opened 15 years ago
Closed 14 years ago
#12755 closed enhancement (fixed)
Detached media sorted in reverse by date
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Media | Keywords: | needs-refresh commit |
Focuses: | Cc: |
Description
Media that's unattached to any post (i.e. at this page: "/wp-admin/upload.php?detached=1" for a WP install) seems to be sorted by post_date ascending (starting with the oldest media) rather than descending. I was able to replicate this in WP 2.9.1, WP 2.9.2 MU and WP 3.0.
I couldn't quite find the correct line to fix, but line 305 of media.php does correct sorting:
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
So it must be somewhere else since that query doesn't run if loading detached media.
Attachments (1)
Change History (10)
#2
@
15 years ago
Is there something else that should be done before this is considered "commitable" to core?
#3
@
15 years ago
- Component changed from Administration to Media
- Keywords has-patch added; media ordering sorting removed
- Milestone changed from Unassigned to 3.1
- Type changed from defect (bug) to enhancement
Assuming it works and doesn't break anything, consider it good for 3.1.
Note: See
TracTickets for help on using
tickets.
Depending on the situation, it's one of these queries: