[wp-trac] [WordPress Trac] #44349: Posts show up multiple times in backend when they have the exact same date
WordPress Trac
noreply at wordpress.org
Fri Sep 26 04:55:45 UTC 2025
#44349: Posts show up multiple times in backend when they have the exact same date
-------------------------------------------+------------------------------
Reporter: wzshop | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 4.9.6
Severity: normal | Resolution:
Keywords: reporter-feedback 2nd-opinion | Focuses:
-------------------------------------------+------------------------------
Comment (by ramonopoly):
This bug came up when I was trying to filter attachment posts by
`media_type`
https://core.trac.wordpress.org/ticket/64042
My workaround was, when multiple attachments have the same post_date, to
add ID as secondary sort to guarantee consistent ordering.
```
$query_args['orderby'] = array( 'date' => $query_args['order'] ?? 'DESC',
'ID' => 'DESC' );
```
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44349#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list