Skip to content

Commit 1ee8648

Browse files
committed
Comments: Enhance comment loading by introducing a fallback for the number of comments per page
1 parent 7f60473 commit 1ee8648

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/js/_enqueues/admin/post.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ window.wp = window.wp || {};
4040
*/
4141
get : function(total, num) {
4242
var st = this.st, data;
43-
if ( ! num )
44-
num = 20;
43+
if ( num ) {
44+
this.num = num;
45+
} else {
46+
num = this.num || 10; // Fallback if not set yet
47+
}
4548

4649
this.st += num;
4750
this.total = total;
@@ -98,7 +101,7 @@ window.wp = window.wp || {};
98101
*/
99102
load: function(total){
100103
this.st = jQuery('#the-comment-list tr.comment:visible').length;
101-
this.get(total);
104+
this.get(total, this.num || 10);
102105
}
103106
};
104107

0 commit comments

Comments
 (0)