Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/js/_enqueues/admin/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ window.wp = window.wp || {};
*/
get : function(total, num) {
var st = this.st, data;
if ( ! num )
num = 20;
if ( num ) {
this.num = num;
} else {
num = this.num || 10; // Fallback if not set yet
}

this.st += num;
this.total = total;
Expand Down Expand Up @@ -98,7 +101,7 @@ window.wp = window.wp || {};
*/
load: function(total){
this.st = jQuery('#the-comment-list tr.comment:visible').length;
this.get(total);
this.get(total, this.num || 10);
}
};

Expand Down
6 changes: 5 additions & 1 deletion src/wp-admin/includes/meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -912,9 +912,13 @@ function post_comment_meta_box( $post ) {
echo '<p id="no-comments">' . __( 'No comments yet.' ) . '</p>';
} else {
$hidden = get_hidden_meta_boxes( get_current_screen() );
$per_page = (int) get_user_option( 'edit_comments_per_page' );
if ( ! $per_page ) {
$per_page = 10;
}
if ( ! in_array( 'commentsdiv', $hidden, true ) ) {
?>
<script type="text/javascript">jQuery(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
<script type="text/javascript">jQuery(function(){commentsBox.get(<?php echo $total; ?>, <?php echo $per_page; ?>);});</script>
<?php
}

Expand Down
Loading