Index: wp-admin/includes/post.php
===================================================================
--- wp-admin/includes/post.php (revision 12081)
+++ wp-admin/includes/post.php (working copy)
@@ -837,6 +837,23 @@
}
/**
+ * 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 (%s)', 'Images (%s)')),
+ 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')),
+ 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')),
+ );
+
+ return apply_filters('post_mime_types', $post_mime_types);
+}
+
+/**
* {@internal Missing Short Description}}
*
* @since unknown
@@ -871,13 +888,8 @@
if ( empty($media_per_page) )
$media_per_page = 20;
$q['posts_per_page'] = $media_per_page;
- $post_mime_types = array( // array( adj, noun )
- 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')),
- 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')),
- 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')),
- );
- $post_mime_types = apply_filters('post_mime_types', $post_mime_types);
+ $post_mime_types = get_post_mime_types();
$avail_post_mime_types = get_available_post_mime_types('attachment');
if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) )
Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php (revision 12081)
+++ wp-admin/includes/media.php (working copy)
@@ -1101,7 +1101,7 @@
* @return string HTML form for attachment.
*/
function get_media_item( $attachment_id, $args = null ) {
- global $post_mime_types, $redir_tab;
+ global $redir_tab;
if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) )
$thumb_url = $thumb_url[0];
@@ -1126,12 +1126,10 @@
$tags = esc_attr(join(', ', $tags));
}
- $type = '';
- if ( isset($post_mime_types) ) {
- $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
- $type = array_shift($keys);
- $type_html = "";
- }
+ $post_mime_types = get_post_mime_types();
+ $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
+ $type = array_shift($keys);
+ $type_html = "";
$form_fields = get_attachment_fields_to_edit($post, $errors);
Index: wp-admin/upload.php
===================================================================
--- wp-admin/upload.php (revision 12081)
+++ wp-admin/upload.php (working copy)
@@ -146,13 +146,7 @@
$page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / 25);
}
- $post_mime_types = array(
- 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')),
- 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')),
- 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')),
- );
- $post_mime_types = apply_filters('post_mime_types', $post_mime_types);
-
+ $post_mime_types = get_post_mime_types();
$avail_post_mime_types = get_available_post_mime_types('attachment');
if ( isset($_GET['post_mime_type']) && !array_intersect( (array) $_GET['post_mime_type'], array_keys($post_mime_types) ) )