' . __( 'Displaying %s–%s of %s' ) . '%s',
number_format_i18n( $start + 1 ),
@@ -346,7 +347,6 @@ if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_
-
-
-
-
-
@@ -265,6 +264,10 @@ if ( $links ) {
+
+
+
+
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index 1919bf04dc..0b26680698 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -633,6 +633,8 @@ unset( $status_links );
?>
+
+
+
+
+
+
diff --git a/wp-admin/upload.php b/wp-admin/upload.php
index 08cd4cf309..94f9c9dcd1 100644
--- a/wp-admin/upload.php
+++ b/wp-admin/upload.php
@@ -143,7 +143,8 @@ if ( isset($_GET['detached']) ) {
} else {
$start = ( (int) $_GET['paged'] - 1 ) * $media_per_page;
$orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ) );
- $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / $media_per_page);
+ $total_orphans = $wpdb->get_var( "SELECT FOUND_ROWS()" );
+ $page_links_total = ceil( $total_orphans / $media_per_page );
}
$post_mime_types = get_post_mime_types();
@@ -219,6 +220,8 @@ if ( !empty($message) ) { ?>
$type_links = array();
$_num_posts = (array) wp_count_attachments();
$_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
+if ( !isset( $total_orphans ) )
+ $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
foreach ( $matches as $type => $reals )
foreach ( $reals as $real )
@@ -234,11 +237,12 @@ foreach ( $post_mime_types as $mime_type => $label ) {
if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
$class = ' class="current"';
-
- $type_links[] = "
" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '';
+ if ( !empty( $num_posts[$mime_type] ) )
+ $type_links[] = "" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '';
}
-$type_links[] = '' . __('Unattached') . '';
-if ( EMPTY_TRASH_DAYS && ( MEDIA_TRASH || !empty($_num_posts['trash']) ) )
+$type_links[] = '' . sprintf( _nx( 'Unattached (%s)', 'Unattached (%s)', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '';
+
+if ( !empty($_num_posts['trash']) )
$type_links[] = '' . sprintf( _nx( 'Trash (%s)', 'Trash (%s)', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '';
echo implode( " |\n", $type_links) . '';
@@ -255,6 +259,7 @@ unset($type_links);