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
This commit is contained in:
parent
8f3cf2d7f0
commit
4122ba6f25
@ -609,15 +609,15 @@ case 'get-comments' :
|
|||||||
if ( !$wp_list_table->has_items() )
|
if ( !$wp_list_table->has_items() )
|
||||||
die('1');
|
die('1');
|
||||||
|
|
||||||
$comment_list_item = '';
|
|
||||||
$x = new WP_Ajax_Response();
|
$x = new WP_Ajax_Response();
|
||||||
|
ob_start();
|
||||||
foreach ( $wp_list_table->items as $comment ) {
|
foreach ( $wp_list_table->items as $comment ) {
|
||||||
get_comment( $comment );
|
get_comment( $comment );
|
||||||
ob_start();
|
$wp_list_table->single_row( $comment );
|
||||||
$wp_list_table->single_row( $comment );
|
|
||||||
$comment_list_item .= ob_get_contents();
|
|
||||||
ob_end_clean();
|
|
||||||
}
|
}
|
||||||
|
$comment_list_item = ob_get_contents();
|
||||||
|
ob_end_clean();
|
||||||
|
|
||||||
$x->add( array(
|
$x->add( array(
|
||||||
'what' => 'comments',
|
'what' => 'comments',
|
||||||
'data' => $comment_list_item
|
'data' => $comment_list_item
|
||||||
|
Loading…
Reference in New Issue
Block a user