[wp-trac] [WordPress Trac] #30412: get_approved_comments() behaviour change with post_id=0

WordPress Trac noreply at wordpress.org
Thu Nov 20 01:51:41 UTC 2014


#30412: get_approved_comments() behaviour change with post_id=0
--------------------------+---------------------------
 Reporter:  dd32          |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.1
Component:  Comments      |     Version:  trunk
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"30402"]:
 {{{
 #!CommitTicketReference repository="" revision="30402"
 Return an empty array from `get_approved_comments()` when `$post_id` is
 empty.

 This behavior was broken when moving the internals to `WP_Comment_Query`
 in
 [30098]. As a result, `get_approved_comments( 0 )` was fetching *all*
 approved
 comments, causing performance issues.

 Props dd32.
 Fixes #30412.
 }}}

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


More information about the wp-trac mailing list