Tweak displaying comments awaiting moderation to their authors. Props wnorris. fixes #4108

git-svn-id: http://svn.automattic.com/wordpress/trunk@5238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-11 03:12:11 +00:00
parent 253bbfcd7f
commit d40f03754d

View File

@ -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);