[wp-trac] [WordPress Trac] #53310: All Comments are not visible in comment section in WordPress Backend Post Section

WordPress Trac noreply at wordpress.org
Fri Aug 1 04:56:50 UTC 2025


#53310: All Comments are not visible in comment section in WordPress Backend Post
Section
--------------------------+------------------------------
 Reporter:  shailu25      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  5.7.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by akshat2802):

 The issue occurs because:

 1] On initial page load, prepare_items() respects the user's screen option
 (e.g., 10 comments per page).

 2] However, subsequent AJAX calls default to loading 20 comments (num),
 which causes inconsistent loading behaviour, e.g., 10 on first load, 20 on
 second.

 3] This results in broken pagination logic:

 - The start offset increases faster than expected.

 - When start >= total, the "Show more comments" button disappears
 prematurely, even though not all comments have been shown (some are still
 stored in extras and never rendered).


 Bug Reference:
 - https://github.com/WordPress/wordpress-
 develop/blob/f8e846bd62b63c44064ce5a28b1bb620245241f9/src/js/_enqueues/admin/post.js#L44
 - https://github.com/WordPress/wordpress-
 develop/blob/f8e846bd62b63c44064ce5a28b1bb620245241f9/src/wp-
 admin/includes/meta-boxes.php#L917
 - https://github.com/WordPress/wordpress-
 develop/blob/f8e846bd62b63c44064ce5a28b1bb620245241f9/src/wp-
 admin/includes/class-wp-comments-list-table.php#L167C3-L169C71

 PR 1: [https://github.com/WordPress/wordpress-develop/pull/9369]
 - Changes the default num value from 20 to 10, to align with the initial
 load (or default screen option).

 PR 2: [https://github.com/WordPress/wordpress-develop/pull/9370]
 - Dynamically retrieves the user's screen option (per_page) and stores it
 in commentsBox.num.

 - All AJAX requests reuse this value, ensuring consistency across loads
 and preventing pagination mismatches.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53310#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list