From 30d7084f60c1ff3ef08723e143c0f69b11148ff8 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 29 Jul 2008 22:14:53 +0000 Subject: [PATCH] Fix gravatars for infinite comments. Props mdawaffe. fixes #7432 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@8490 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 5 ++++- wp-includes/js/wp-lists.js | 2 ++ wp-includes/script-loader.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 7564a8b695..4485935147 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -392,13 +392,16 @@ case 'add-comment' : list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1 ); + if ( get_option('show_avatars') ) + add_filter( 'comment_author', 'floated_admin_avatar' ); + if ( !$comments ) die('1'); $x = new WP_Ajax_Response(); foreach ( (array) $comments as $comment ) { get_comment( $comment ); ob_start(); - _wp_comment_row( $comment->comment_ID, $mode, false ); + _wp_comment_row( $comment->comment_ID, $mode, $status ); $comment_list_item = ob_get_contents(); ob_end_clean(); $x->add( array( diff --git a/wp-includes/js/wp-lists.js b/wp-includes/js/wp-lists.js index 884f02a6fd..a4d5df3230 100644 --- a/wp-includes/js/wp-lists.js +++ b/wp-includes/js/wp-lists.js @@ -88,6 +88,8 @@ var wpList = { var res = wpAjax.parseAjaxResponse(r, s.response, s.element); if ( !res || res.errors ) { return false; } + if ( true === res ) { return true; } + jQuery.each( res.responses, function() { wpList.add.call( list, this.data, $.extend( {}, s, { // this.firstChild.nodevalue pos: this.position || 0, diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 3778526020..98f19e4a1c 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -50,7 +50,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080622' ); - $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080411' ); + $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080729' ); $scripts->localize( 'wp-lists', 'wpListL10n', array( 'url' => admin_url('admin-ajax.php') ) );