[wp-trac] [WordPress Trac] #35192: Comments_clauses filter

WordPress Trac noreply at wordpress.org
Thu Jan 7 04:16:57 UTC 2016


#35192: Comments_clauses filter
--------------------------+--------------------
 Reporter:  firebird75    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.4.2
Component:  Comments      |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+--------------------
Changes (by boonebgorges):

 * milestone:  Awaiting Review => 4.4.2


Comment:

 Hm, this is an unpleasant problem. It'd be far easier to reset the 'from'
 clause, but I'm afraid that this might result in incorrect query data in
 some cases.

 Can you share your `comment_clauses` callback, or explain it in more
 details, so I can get a sense of a real-world example of how you're
 filtering here? Are you joining another table just in order to get more
 data in the query, or are you using the information from that join to
 exclude/include particular results?

 I have a feeling that the proper solution here is to use (a version of)
 the post-`comment_clauses`-filter `WHERE` clause when building the query
 in `fill_descendants()`. Unfortunately, this is not straightforward - in
 order to remove the `parent`, `parent__in`, and `parent__not_in` clauses,
 it's probably going to be necessary to do some string manipulation.

 I'll put this in 4.4.2 because it's a regression in 4.4, but if the
 changes required to make it work are too extensive, it may have to wait
 for 4.5.

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


More information about the wp-trac mailing list