The descendant query in `WP_Comment_Query::fill_descendants()` uses the clauses of the main `get_comment_ids()` query as a basis, discarding the `parent`, `parent__in`, and `parent__not_in` clauses. As implemented in WP 4.4 [34546], the WHERE clause was assembled in such a way that any modifications applied using the `comments_clauses` filter were not inherited by `fill_descendants()`. This resulted in descendant queries that did not always properly filter results, and sometimes contained syntax errors. The current changeset fixes the problem by using the post-filter WHERE clause as the basis for the `fill_descendants()` query. This change requires a new approach for eliminating the unneeded parent-related clauses: instead of eliminating values in an associative array, we must use regular expressions. Props boonebgorges, firebird75. Fixes #35192. Built from https://develop.svn.wordpress.org/trunk@36277 git-svn-id: http://core.svn.wordpress.org/trunk@36244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
38 KiB
38 KiB