Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php (revision 7346)
+++ wp-admin/includes/media.php (working copy)
@@ -956,8 +966,14 @@
foreach ( $matches as $_type => $reals )
foreach ( $reals as $real )
$num_posts[$_type] += $_num_posts[$real];
-$class = empty($_GET['post_mime_type']) ? ' class="current"' : '';
-$type_links[] = "
".__('All Types')."";
+// If available type specified by media button clicked, filter by that type
+if ( empty($_GET['post_mime_type']) && !empty($num_posts[$type]) ) {
+ $_GET['post_mime_type'] = $type;
+ list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
+}
+if ( empty($_GET['post_mime_type']) || $_GET['post_mime_type'] == 'all' )
+ $class = ' class="current"';
+$type_links[] = "'all', 'paged'=>false, 'm'=>false)) . "'$class>".__('All Types')."";
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';