From 4122ba6f25938a243945dad510b1585670ab9908 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 12 May 2011 05:50:53 +0000 Subject: [PATCH] Move output buffering out of a loop, collapsing it into one buffer. props mitchoyoshitaka, fixes #17352. git-svn-id: https://develop.svn.wordpress.org/trunk@17897 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 07be388296..2f20dc66d0 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -609,15 +609,15 @@ case 'get-comments' : if ( !$wp_list_table->has_items() ) die('1'); - $comment_list_item = ''; $x = new WP_Ajax_Response(); + ob_start(); foreach ( $wp_list_table->items as $comment ) { get_comment( $comment ); - ob_start(); - $wp_list_table->single_row( $comment ); - $comment_list_item .= ob_get_contents(); - ob_end_clean(); + $wp_list_table->single_row( $comment ); } + $comment_list_item = ob_get_contents(); + ob_end_clean(); + $x->add( array( 'what' => 'comments', 'data' => $comment_list_item