Skip to content

Instantly share code, notes, and snippets.

@johnalarcon
Created July 24, 2019 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnalarcon/5df7e8b246f6e0dc8ec265220c5d0a49 to your computer and use it in GitHub Desktop.
Save johnalarcon/5df7e8b246f6e0dc8ec265220c5d0a49 to your computer and use it in GitHub Desktop.
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