WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#29065 closed defect (bug) (fixed)

Media grid not filtering for Unattached Media

Reported by: UaMV Owned by: wonderboymusic
Milestone: 4.0 Priority: normal
Severity: normal Version: 4.0
Component: Media Keywords: has-patch
Focuses: javascript, administration Cc:

Description

When viewing Unattached Media at wp-admin/upload.php?detached=1&mode=grid, all media is shown. Switching to list mode at wp-admin/upload.php?detached=1&mode=list filters to only the unattached media.

Attachments (2)

29065.diff (1.9 KB) - added by wonderboymusic 7 years ago.
29065.2.diff (2.2 KB) - added by ocean90 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 @UaMV
7 years ago

  • Keywords needs-patch 2nd-opinion added

#2 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 4.0

Related: #28946

@wonderboymusic
7 years ago

#3 @wonderboymusic
7 years ago

  • Focuses javascript added
  • Keywords has-patch added; needs-patch 2nd-opinion removed

29065.diff makes the filters possible for unattached

@ocean90
7 years ago

#4 @ocean90
7 years ago

I think the unattached filter should only be added to wp.media.view.AttachmentFilters.All, see 29065.2.diff. The mime-types filter is added in 4.0 for the grid, but we could use the ".All" filter here too and just check inside the filter if wp.media.view.settings.post.id is set.

#5 @wonderboymusic
7 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 29426:

In media.view.AttachmentFilters.All, make uploaded conditional upon media.view.settings.post.id and include a new filter: unattached.

Drop the mime-types filter and related class (which was added for Media Grid) and use all instead.

Props ocean90, wonderboymusic.
Fixes #29065.

Note: See TracTickets for help on using tickets.