Ticket #17020: comment-filters_3.2.patch
File comment-filters_3.2.patch, 1.9 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/comment.php
115 115 $post_id_array = array_map('intval', $post_id_array); 116 116 $post_id_in = "'" . implode("', '", $post_id_array) . "'"; 117 117 118 $pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A );118 $pending = $wpdb->get_results( apply_filters( 'pending_comments_query', "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", $post_id ), ARRAY_A ); 119 119 120 120 if ( $single ) { 121 121 if ( empty($pending) ) -
wp-admin/includes/dashboard.php
609 609 $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] ) 610 610 ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5; 611 611 612 while ( count( $comments ) < $total_items && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50") ) {612 while ( count( $comments ) < $total_items && $possible = $wpdb->get_results( apply_filters( 'dashboard_recent_comments_query', "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) ) { 613 613 614 614 foreach ( $possible as $comment ) { 615 615 if ( count( $comments ) >= $total_items )