Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add "Documents" to media library filter options
<?php
function codepotent_add_media_library_document_filter($post_mime_types) {
$post_mime_types['application'] = [
0 => 'Documents',
1 => 'Manage Documents',
2 => [
0 => 'Document (%s)',
1 => 'Documents (%s)',
'singular' => 'Document (%s)',
'plural' => 'Documents (%s)',
'context' => '',
'domain' => '',
]
];
return $post_mime_types;
}
add_filter('post_mime_types', 'codepotent_add_media_library_document_filter');
// upload.php?attachment-filter=post_mime_type%3Aapplication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.