[wp-trac] [WordPress Trac] #35068: Comments not showing up when there are unapproved messages

WordPress Trac noreply at wordpress.org
Mon Dec 21 03:10:47 UTC 2015

#35068: Comments not showing up when there are unapproved messages
 Reporter:  arash_hemmat             |       Owner:  boonebgorges
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  4.4.1
Component:  Comments                 |     Version:  4.4
 Severity:  critical                 |  Resolution:  fixed
 Keywords:  has-patch needs-testing  |     Focuses:
Changes (by boonebgorges):

 * status:  reopened => closed
 * resolution:   => fixed


 In [changeset:"36041"]:
 #!CommitTicketReference repository="" revision="36041"
 Respect approval status when determining comment page count in

 Since 4.4, when fetching the first page of comments and the 'newest'
 are set to display first, `comments_template()` must perform arithmetic to
 determine which comments to show. See #8071. This arithmetic requires the
 total comment count for the current post, which is calculated with a
 `WP_Comment_Query`. This secondary comment query did not properly account
 non-approved comment statuses; all unapproved comments should be part of
 comment count for admins, and individual users should have their own
 unapproved comments included in the count. As a result,
 was, in some cases, being fooled into thinking that a post had fewer
 available for pagination than it actually had, which resulted in empty
 of comments.

 We correct this problem by mirroring 'status' and 'include_unapproved'
 of the main comment query within the secondary query used to calculate

 Merges [36040] to the 4.4 branch.

 Fixes #35068.

Ticket URL: <https://core.trac.wordpress.org/ticket/35068#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list