[wp-trac] [WordPress Trac] #64467: Grid view displays attachments in the wrong order when an order query var is present but not normalized

WordPress Trac noreply at wordpress.org
Mon Apr 20 14:07:06 UTC 2026


#64467: Grid view displays attachments in the wrong order when an order query var
is present but not normalized
-------------------------------------+-------------------------------------
 Reporter:  trivedikavit             |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  7.1
Component:  Media                    |     Version:
 Severity:  minor                    |  Resolution:
 Keywords:  has-screenshots          |     Focuses:  javascript,
  changes-requested has-patch has-   |  administration
  unit-tests                         |
-------------------------------------+-------------------------------------

Comment (by darshitrajyaguru97):

 == Patch Testing Report ==

 I tested the proposed patch and verified the behavior before and after
 applying it.

 === Environment ===
 * WordPress: 7.0-beta3-61849-src
 * PHP: 8.2.29
 * Server: Nginx
 * Database: MySQL
 * Browser: Chrome
 * OS: Windows 10
 * Theme: Twenty Twenty-Five
 * Plugins: None

 === Steps to Reproduce ===
 1. Upload multiple images to the Media Library with identifiable
 naming/order.
 2. Visit: `/wp-admin/upload.php?mode=grid&orderby=date&order=desc`
 3. Observe the order of media items.

 === Before Patch ===
 * The `order=desc` parameter was not respected.
 * Media items were displayed in ascending order (1 → 10).
 * Changing `order` values (e.g., `DESC`, invalid values like `pizza`) had
 no effect.

 === After Applying Patch ===
 * The `order=desc` parameter is correctly applied.
 * Media items are now displayed in descending order (10 → 1).
 * Ordering behavior aligns with expected query parameter handling.

 === Expected Result ===
 * The `order` query parameter should properly control sorting direction
 (ASC/DESC).

 === Actual Result ===
 * ✅ After patch: Sorting works correctly as expected.


 === Conclusion ===
 The patch successfully fixes the issue. The `order` parameter is now
 properly respected in Media Library grid view.

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


More information about the wp-trac mailing list