[wp-trac] [WordPress Trac] #35175: Page parameter no longer works in wp_list_comments

WordPress Trac noreply at wordpress.org
Sun Dec 20 20:55:15 UTC 2015


#35175: Page parameter no longer works in wp_list_comments
--------------------------+-----------------------------
 Reporter:  smerriman     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  4.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 `wp_list_comments` has a `page` parameter which allows you to display any
 page of comments. Since WP 4.4 introduced the idea of only querying the
 comments that are 'needed', this no longer works at all. Whatever you pass
 in, only the 'current' page of comments gets displayed.

 I was previously using this in two ways:

 a) Due to the long standing 'bug' of the first page of comments possibly
 being very empty when comment order is reversed (which was nearly fixed
 then reverted in recent tickets), I display both the first two pages of
 comments in comments.php. The second 'page' now duplicates the first.

 b) I was using AJAX to display further pages of comments, by calling
 comments_template and passing in a custom page parameter to
 wp_list_comments. This also fails.

 There should be a solution that make the page parameter work in the way it
 used to - perhaps if the page being requested is not available, perform
 another query at that point.

 Perhaps additionally, the parameters passed to WP_Comment_Query in the
 comments_template function should be filterable so you can tell it what
 pages you actually need if the defaults don't suffice, rather than relying
 on a single global cpage query variable.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35175>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list