Ticket #17020: get-approved-comments-3.2.diff
File get-approved-comments-3.2.diff, 745 bytes (added by , 14 years ago) |
---|
-
wp-includes/comment.php
105 105 * @param int $post_id The ID of the post 106 106 * @return array $comments The approved comments 107 107 */ 108 function get_approved_comments($post_id) { 109 global $wpdb; 110 return $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post_id)); 108 function get_approved_comments($post_id) { 109 $comment_args = array( 110 'post_id' => $post_id, 111 'status' => 'approved', 112 'orderby' => 'comment_date', 113 ); 114 115 return get_comments( $comment_args ); 111 116 } 112 117 113 118 /**