#22514 closed enhancement (fixed)
Add a way to filter attachments in the media modal
Reported by: | koopersmith | Owned by: | koopersmith |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
As discussed in #20258.
Change History (12)
#1
@
12 years ago
- Owner set to koopersmith
- Resolution set to fixed
- Status changed from new to closed
#2
follow-up:
↓ 3
@
12 years ago
- Cc pavelevap@… added
- Resolution fixed deleted
- Status changed from closed to reopened
Great! But there are other problems:
1) String "Uploaded to this post" is not accurate - files can be uploaded also to Pages or CPT.
2) Default view should display files uploaded to post and not the whole media library? People usually want to work with uploaded files and there is no need to show them all files. If you want to show only related (uploaded) files, you have to select a filter. It is also change of current workflow for users, so there should be at least the chance to enable this filter by default with the help of some hook.
#3
in reply to:
↑ 2
@
12 years ago
- Cc xoodrew@… added
Replying to pavelevap:
Great! But there are other problems:
1) String "Uploaded to this post" is not accurate - files can be uploaded also to Pages or CPT.
Related: #19696. This may be a discussion for another day, but I wonder about something like this?
'uploadedToThisPost' => sprintf( __( 'Uploaded to this %s' ), strtolower( $post_type_object->labels->singular_name ) ),
A cursory check of posts vs pages vs a custom post type yielded good results for me.
#4
@
12 years ago
Also, this should use:
- get_post_mime_types() (we'll only be using the first item in each array, but it's the filter that is important).
- get_available_post_mime_types(), to know what mime types are in use.
The available mime types can be intersected with get_post_mime_types() using wp_match_mime_types(). Using get_available_post_mime_types() is optional, given that we don't refresh the page and therefore couldn't easily account for files of a new type being uploaded. But, when new attachments are uploaded, we could see if their type is now available, and show them at that point. Huge bite of the apple, though.
#6
in reply to:
↑ 5
@
12 years ago
Replying to DrewAPicture:
Expanding on comment:3, another option would be to introduce a filter and you could change the string to whatever you want. Again, similar in concept to #19696.
We're one step ahead of you — check out the media_view_strings
filter and #21092.
#7
@
12 years ago
We should add page
strings by default by checking is_post_type_hierarchical()
.
The dropdown should also use get_post_mime_types()
. Intersecting those results with get_available_post_mime_types()
would be nice, but not necessary.
#10
follow-up:
↓ 11
@
12 years ago
Added filters does not show when you click "Choose a Featured Image"? Users usually want to select featured image from images uploaded (attached) to post.
In 22712: