Changeset 29965 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 10/19/2014 07:38:16 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/comment-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r29908 r29965 1113 1113 $comment_author_url = esc_url($commenter['comment_author_url']); 1114 1114 1115 /** @todo Use API instead of SELECTs. */ 1116 if ( $user_ID) { 1117 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) ) ORDER BY comment_date_gmt", $post->ID, $user_ID)); 1118 } else if ( empty($comment_author) ) { 1119 $comments = get_comments( array('post_id' => $post->ID, 'status' => 'approve', 'order' => 'ASC') ); 1120 } else { 1121 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date_gmt", $post->ID, wp_specialchars_decode($comment_author,ENT_QUOTES), $comment_author_email)); 1122 } 1115 $comment_args = array( 1116 'order' => 'ASC', 1117 'orderby' => 'comment_date_gmt', 1118 'status' => 'approve', 1119 'post_id' => $post->ID, 1120 ); 1121 1122 if ( $user_ID ) { 1123 $comment_args['include_unapproved'] = array( $user_ID ); 1124 } else if ( ! empty( $comment_author ) ) { 1125 $comment_args['include_unapproved'] = array( $comment_author_email ); 1126 } 1127 1128 $comments = get_comments( $comment_args ); 1123 1129 1124 1130 /**
Note: See TracChangeset
for help on using the changeset viewer.