mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@34069 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,11 @@ commentsBox = {
|
||||
);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
load: function(total){
|
||||
this.st = jQuery('#the-comment-list tr.comment:visible').length;
|
||||
this.get(total);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user