Media: Dynamically generate attachment filters using get_post_mime_types().
Moves `get_post_mime_types()` from `wp-admin/includes/post.php` to `wp-includes/post.php`. fixes #22514, see #21390. git-svn-id: http://core.svn.wordpress.org/trunk@22743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -2179,6 +2179,23 @@ function wp_count_attachments( $mime_type = '' ) {
|
||||
return (object) $stats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default post mime types
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_post_mime_types() {
|
||||
$post_mime_types = array( // array( adj, noun )
|
||||
'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
|
||||
'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
|
||||
'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
|
||||
);
|
||||
|
||||
return apply_filters('post_mime_types', $post_mime_types);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a MIME-Type against a list.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user