When clicking "Show More Comments" in the Comments meta box on the Edit Post screen, change the click behavior to call a new class method on commentsBox, ->load(), that resets st (cool name) to the number of visible <tr>s before calling ->get(). This will account for spam'd and trash'd comments when returning comments at the proper offset.

Props utkarshpatel.
Fixes #33829.

Built from https://develop.svn.wordpress.org/trunk@34069


git-svn-id: http://core.svn.wordpress.org/trunk@34037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-12 02:28:26 +00:00
parent a69e71fafe
commit b453af5718
5 changed files with 9 additions and 4 deletions

View File

@ -690,7 +690,7 @@ function post_comment_meta_box( $post ) {
}
?>
<p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <span class="spinner"></span></p>
<p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <span class="spinner"></span></p>
<?php
}

View File

@ -59,6 +59,11 @@ commentsBox = {
);
return false;
},
load: function(total){
this.st = jQuery('#the-comment-list tr.comment:visible').length;
this.get(total);
}
};

File diff suppressed because one or more lines are too long

View File

@ -853,7 +853,7 @@ function get_comment_text( $comment_ID = 0, $args = array() ) {
function comment_text( $comment_ID = 0, $args = array() ) {
$comment = get_comment( $comment_ID );
$comment_text = get_comment_text( $comment_ID , $args );
$comment_text = get_comment_text( $comment, $args );
/**
* Filter the text of a comment to be displayed.
*

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34068';
$wp_version = '4.4-alpha-34069';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.