From 9c18de14847dba229bdf419c9f02b343e00c1be3 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 25 Mar 2011 20:12:32 +0000 Subject: [PATCH] Fix discrepancy in the nested loop in the Recent Comments dashboard widget, props ocean90, fixes #16846 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@17556 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 8f937f36ac..2b10928b02 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -609,7 +609,7 @@ function wp_dashboard_recent_comments() { $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] ) ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5; - while ( count( $comments ) < 5 && $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" ) ) { + 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" ) ) { foreach ( $possible as $comment ) { if ( count( $comments ) >= $total_items )