diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 02ea682f2d..ed41bb6f12 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -288,7 +288,9 @@ function comments_template( $file = '/comments.php' ) { extract($commenter); // TODO: Use API instead of SELECTs. - if ( empty($comment_author) ) { + if ( $user_ID) { + $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND (comment_approved = '1' OR ( user_id = '$user_ID' AND comment_approved = '0' ) ) ORDER BY comment_date"); + } else if ( empty($comment_author) ) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); } else { $author_db = $wpdb->escape($comment_author);