diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php
index f1ed4d6d5b..60617053fd 100644
--- a/wp-admin/edit-comments.php
+++ b/wp-admin/edit-comments.php
@@ -98,6 +98,8 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
$status_links = array();
$num_comments = wp_count_comments();
$stati = array('moderated' => sprintf(__('Awaiting Moderation (%s)'), ""), 'approved' => __('Approved'));
+$class = ( '' === $comment_status ) ? ' class="current"' : '';
+$status_links[] = "
".__('All Comments')."";
foreach ( $stati as $status => $label ) {
$class = '';
@@ -106,8 +108,6 @@ foreach ( $stati as $status => $label ) {
$status_links[] = "" . $label . '';
}
-$class = ( '' === $comment_status ) ? ' class="current"' : '';
-$status_links[] = "".__('All Comments')."";
echo implode(' | ', $status_links) . '';
unset($status_links);
?>
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index c90e692a6c..d8f0e8be88 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -259,7 +259,7 @@ if (current_user_can('upload_files') && false) {
diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php
index 5ea942e5b6..569fc68bbf 100644
--- a/wp-admin/edit-pages.php
+++ b/wp-admin/edit-pages.php
@@ -75,6 +75,8 @@ $avail_post_stati = get_available_post_statuses('page');
$status_links = array();
$num_posts = wp_count_posts('page', 'readable');
+$class = empty($_GET['post_status']) ? ' class="current"' : '';
+$status_links[] = "".__('All Pages')."";
foreach ( $post_stati as $status => $label ) {
$class = '';
@@ -87,8 +89,6 @@ foreach ( $post_stati as $status => $label ) {
$status_links[] = "" .
sprintf($label[2], $num_posts->$status) . '';
}
-$class = empty($_GET['post_status']) ? ' class="current"' : '';
-$status_links[] = "".__('All Pages')."";
echo implode(' |', $status_links) . '';
unset($status_links);
?>
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index 8da14ab17f..0752da21df 100644
--- a/wp-admin/edit.php
+++ b/wp-admin/edit.php
@@ -82,6 +82,8 @@ if ( is_single() ) {
".__('All Posts')."";
foreach ( $post_stati as $status => $label ) {
$class = '';
@@ -96,8 +98,6 @@ foreach ( $post_stati as $status => $label ) {
$status_links[] = "" .
sprintf($label[2], $num_posts->$status) . '';
}
-$class = empty($_GET['post_status']) ? ' class="current"' : '';
-$status_links[] = "".__('All Posts')."";
echo implode(' |', $status_links) . '';
unset($status_links);
?>
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 7d6f27e947..b6c760e0e7 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -929,6 +929,8 @@ $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_po
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')."";
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';
@@ -940,8 +942,6 @@ foreach ( $post_mime_types as $mime_type => $label ) {
$type_links[] = "$mime_type, 'paged'=>false)) . "'$class>" . sprintf($label[2], "{$num_posts[$mime_type]}") . '';
}
-$class = empty($_GET['post_mime_type']) ? ' class="current"' : '';
-$type_links[] = "".__('All Types')."";
echo implode(' | ', $type_links) . '';
unset($type_links);
?>
diff --git a/wp-admin/upload.php b/wp-admin/upload.php
index a4c87b6a45..89a23faba6 100644
--- a/wp-admin/upload.php
+++ b/wp-admin/upload.php
@@ -88,6 +88,8 @@ $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_po
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')."";
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';
@@ -100,8 +102,6 @@ foreach ( $post_mime_types as $mime_type => $label ) {
$type_links[] = "" .
sprintf($label[2], $num_posts[$mime_type]) . '';
}
-$class = empty($_GET['post_mime_type']) ? ' class="current"' : '';
-$type_links[] = "".__('All Types')."";
echo implode(' | ', $type_links) . '';
unset($type_links);
?>