Tweak displaying comments awaiting moderation to their authors. Props wnorris. fixes #4108
git-svn-id: https://develop.svn.wordpress.org/trunk@5238 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f69917f454
commit
9dcdbbd7ae
|
@ -288,7 +288,9 @@ function comments_template( $file = '/comments.php' ) {
|
||||||
extract($commenter);
|
extract($commenter);
|
||||||
|
|
||||||
// TODO: Use API instead of SELECTs.
|
// 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");
|
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date");
|
||||||
} else {
|
} else {
|
||||||
$author_db = $wpdb->escape($comment_author);
|
$author_db = $wpdb->escape($comment_author);
|
||||||
|
|
Loading…
Reference in New Issue