Created
July 24, 2019 19:32
-
-
Save johnalarcon/5df7e8b246f6e0dc8ec265220c5d0a49 to your computer and use it in GitHub Desktop.
Add "Documents" to media library filter options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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