[wp-trac] [WordPress Trac] #35432: `wp_list_comments()` should perform a more modest fallback comment query

WordPress Trac noreply at wordpress.org
Wed Jan 13 04:17:31 UTC 2016


#35432: `wp_list_comments()` should perform a more modest fallback comment query
--------------------------+----------------------------
 Reporter:  boonebgorges  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  Comments      |    Version:  4.4
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:  performance   |
--------------------------+----------------------------
 Previously: #35175, #35356, #8071.

 In 4.4, `comments_template()` was updated so that it no longer queries for
 every single comment belonging to a post; instead, it only fetches the
 comments appropriate for the current comment-page. See #8071. This change
 introduced a bug in `wp_list_comments()`: since all of the post's comments
 were no longer available in `$wp_query->comments`, it was no longer
 possible to pass custom (read: differing from `$wp_query`) pagination
 params to `wp_list_comments()` and get the proper comments back. We
 addressed this problem in 4.4.1 by adding a clause to `wp_list_comments()`
 that falls back on the old behavior - querying for all of the post's
 comments - if non-default pagination params are provided. See #35175
 [36157].

 This fallback solution is obviously not ideal. Querying for all of a
 post's comments is what #8071 was supposed to fix. `wp_list_comments()`,
 like `comments_template()`, should be able to perform a fallback query
 that fetches only the required comments.

 The necessary logic already exists in `comments_template()`, so this may
 be a relatively simple matter of porting the functionality over, or
 abstracting it for use in both functions.

 cc @smerriman

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


More information about the wp-trac mailing list