I'm using the following code to add new sorting options to my Media Library:
function modify_post_mime_types( $post_mime_types ) {
$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' ) );
$post_mime_types['application/vnd.openxmlformats-officedocument.presentationml.presentation'] = array( __( 'Powerpoints' ), __( 'Manage Powerpoints' ), _n_noop( 'Powerpoints <span class="count">(%s)</span>', 'Powerpoints <span class="count">(%s)</span>' ) );
$post_mime_types['application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document'] = array( __( 'Documents' ), __( 'Manage Documents' ), _n_noop( 'Documents <span class="count">(%s)</span>', 'Documents <span class="count">(%s)</span>' ) );
return $post_mime_types;
}
add_filter( 'post_mime_types', 'modify_post_mime_types' );
Which appears to be working great for the JavaScript-enabled "Grid" mode:
However, in the "List" mode, clicking on the entries shows all the extensions/files (even though it is counting them properly) as shown:
Here's the URL it is redirecting to for the PDFs:
wp-admin/upload.php?mode=list&attachment-filter=post_mime_type%3Aapplication%252Fpdf&m=0&filter_action=Filter&s&action=-1&paged=1&action2=-1&affected&_ajax_nonce=093720f202&ps
If I try with the standard Wordpress "Images" filter, it indeed works. Here's the URL it gives for that:
wp-admin/upload.php?mode=list&attachment-filter=post_mime_type%3Aimage&m=0&filter_action=Filter&s&action=-1&paged=1&action2=-1&affected&_ajax_nonce=093720f202&ps
I'm thinking this is perhaps a Wordpress bug, but just making sure if anybody knows anything here.