[wp-trac] [WordPress Trac] #32762: Comment meta queries cannot be set in WP_Comment_Query via pre_get_comments

WordPress Trac noreply at wordpress.org
Tue Jun 23 13:31:04 UTC 2015


#32762: Comment meta queries cannot be set in WP_Comment_Query via pre_get_comments
--------------------------+------------------
 Reporter:  needle        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.3
Component:  Comments      |     Version:  4.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------

Comment (by needle):

 @boonebgorges Thanks for the feedback. I wasn't pointing to the forum post
 because of the code therein, but rather to show that others had noticed
 that meta queries built via `pre_get_comments` were failing ;-)

 I've managed to get things working as expected by using the
 `parse_comment_query` filter instead, since it fires prior to anything
 I've highlighted above. However, the `pre_get_comments` hook seems to be
 the one that all the discussion I've seen online seems to suggest as the
 entry point for filtering comments.

 Although it looks like the `parse_comment_query` filter was introduced in
 [31793], my main concern is how plugins support comment meta query
 filtering across the different possible WordPress installs that may or may
 not have this filter. Your patch would seem to address the issue for my
 purposes, but as you say, may introduce backpat issues for others.

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


More information about the wp-trac mailing list