[wp-trac] [WordPress Trac] #8071: Refrain from querying all the comments on a post when paged

WordPress Trac noreply at wordpress.org
Thu Oct 15 21:24:12 UTC 2015


#8071: Refrain from querying all the comments on a post when paged
------------------------------------+---------------------------
 Reporter:  markjaquith             |       Owner:  boonebgorges
     Type:  task (blessed)          |      Status:  reopened
 Priority:  normal                  |   Milestone:  4.4
Component:  Comments                |     Version:  2.7
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+---------------------------
Changes (by boonebgorges):

 * keywords:  dev-feedback needs-patch => dev-feedback has-patch


Comment:

 In an effort to minimize comment "permalink" breakage,
 [attachment:8071.8.diff] does the following:

 * Restores 'page_comments'
 * Changes the default value for 'page_comments' from 0 to 1
 * Introduces a couple of new helper functions.
 `wp_get_top_level_comments_count( $post_id )` does what it says.
 `wp_get_comment_pages_count( $post_id )` gets the *canonical* comment-page
 count for a given post. By "canonical" I mean the count that is actually
 used when WP how to build comment pages (in `comment_template()`). This
 means that it respects threading as well as `comments_per_page`. It also
 doesn't require full comment objects. In these ways, it differs from the
 existing `get_comment_pages_count()`.
 * When `page_comments` is disabled, and the comment count for a post is
 above the (filterable) 'comment_paging_threshold', comment pagination is
 forced, with 'comment_paging_threshold' used as the per-page value.

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


More information about the wp-trac mailing list