[wp-trac] [WordPress Trac] #19372: Don't call wp_count_comments() when we don't need to

WordPress Trac noreply at wordpress.org
Wed Nov 18 21:33:05 UTC 2015


#19372: Don't call wp_count_comments() when we don't need to
----------------------------+-----------------------------
 Reporter:  johnbillion     |       Owner:  wonderboymusic
     Type:  task (blessed)  |      Status:  closed
 Priority:  normal          |   Milestone:  4.4
Component:  Comments        |     Version:  3.2
 Severity:  minor           |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:  performance
----------------------------+-----------------------------
Changes (by boonebgorges):

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


Comment:

 In [changeset:"35691"]:
 {{{
 #!CommitTicketReference repository="" revision="35691"
 Eliminate a db query when building the admin menu for non-privileged
 users.

 Users who cannot `edit_posts` do not see the Comments nav item anyway, so
 don't bother running a query that gets a comment count to display in the
 menu.

 Props bordoni, johnbillion.
 Fixes #19372.
 }}}

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


More information about the wp-trac mailing list