By default the WordPress Media Library allows you to filter results by their type or date. How can I add a third drop down to list and filter by author?
Currently we have this:
I'd like to have the following:
According to this ticket (unless I'm reading it wrong) the code was added three years ago to /wp-admin/includes/class-wp-media-list-table.php
to allow this, but I don't see how this actually works.
The codex also says that it's possible to modify the media library modal window you get when editing a page or post with:
add_filter( 'ajax_query_attachments_args', 'show_current_user_attachments', 10, 1 );
function show_current_user_attachments( $query = array() ) {
$user_id = get_current_user_id();
if( $user_id ) {
$query['author'] = $user_id;
}
return $query;
}
So I'd think that it's possible to do something similar on the main Media Library page, but I can't see how.