diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php
index cf87b68808..ba3a3f1d08 100644
--- a/wp-admin/edit-comments.php
+++ b/wp-admin/edit-comments.php
@@ -72,7 +72,9 @@ require_once('admin-header.php');
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']);
-$comment_status = isset($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : '';
+$comment_status = !empty($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : '';
+
+$comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : '';
$post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0;
@@ -134,13 +136,14 @@ $stati = array(
);
$class = ( '' === $comment_status ) ? ' class="current"' : '';
$status_links[] = "
".__('Show All Comments')."";
+$type = ( !$comment_type && 'all' != $comment_type ) ? '' : "&comment_type=$comment_type";
foreach ( $stati as $status => $label ) {
$class = '';
if ( $status == $comment_status )
$class = ' class="current"';
- $status_links[] = "$label";
+ $status_links[] = "$label";
}
$status_links = apply_filters( 'comment_status_links', $status_links );
@@ -150,6 +153,29 @@ unset($status_links);
?>
+
+
+
+
escape($s);
$comments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE
@@ -1561,9 +1570,10 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0
comment_author_IP LIKE ('%$s%') OR
comment_content LIKE ('%$s%') ) AND
$approved
+ $typesql
ORDER BY comment_date_gmt DESC LIMIT $start, $num");
} else {
- $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved $post ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
+ $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved $post $typesql ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
}
update_comment_cache($comments);