Ticket #17024: get-approved-comments_filter_3.2.patch
File get-approved-comments_filter_3.2.patch, 831 bytes (added by , 14 years ago) |
---|
-
wp-includes/comment.php
107 107 */ 108 108 function get_approved_comments($post_id) { 109 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));110 return $wpdb->get_results( apply_filters( 'get_approved_comments_query', $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post_id ), $post_id ) ); 111 111 } 112 112 113 113 /** … … 475 475 } 476 476 } 477 477 478 return $comment_count;478 return apply_filters( 'get_comment_count', $comment_count, $post_id ); 479 479 } 480 480 481 481 //