Skip to content

Commit

Permalink
Fix gravatars for infinite comments. Props mdawaffe. fixes #7432 for 2.6
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed Jul 29, 2008
1 parent abccdc8 commit 654ba10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion wp-admin/admin-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,16 @@

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(
Expand Down
2 changes: 2 additions & 0 deletions wp-includes/js/wp-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
) );
Expand Down

0 comments on commit 654ba10

Please sign in to comment.