[wp-trac] [WordPress Trac] #50521: comments_pre_query doesn't align with other pre_query filters

WordPress Trac noreply at wordpress.org
Thu Sep 17 19:54:02 UTC 2020


#50521: comments_pre_query doesn't align with other pre_query filters
-----------------------------------+---------------------
 Reporter:  dinhtungdu             |       Owner:  imath
     Type:  defect (bug)           |      Status:  closed
 Priority:  normal                 |   Milestone:  5.6
Component:  Comments               |     Version:  5.3
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+---------------------
Changes (by SergeyBiryukov):

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


Comment:

 In [changeset:"48990" 48990]:
 {{{
 #!CommitTicketReference repository="" revision="48990"
 Comments: Assign the array of comment data returned from the
 `comments_pre_query` filter to the `comments` property of the current
 `WP_Comment_Query` instance.

 This avoids the performance overhead of calling
 `WP_Comment_Query::get_comments()` twice: first when creating the object
 instance, then to retrieve the filtered results.

 This also makes the filter a bit more consistent with other similar
 filters, e.g. `posts_pre_query`, `terms_pre_query`, or `users_pre_query`.

 Follow-up to [46086].

 Props dinhtungdu, imath, spacedmonkey, adamsilverstein, SergeyBiryukov.
 Fixes #50521.
 }}}

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


More information about the wp-trac mailing list