WordPress/wp-includes
Boone Gorges 98fb5f0bdb Use the post-filter WHERE clause when querying for comment descendants.
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
2016-01-13 04:01:26 +00:00
..
2015-07-23 10:03:24 +00:00
2015-06-28 00:17:25 +00:00
2015-06-28 15:27:24 +00:00
2015-09-26 07:04:28 +00:00
2015-12-06 21:50:25 +00:00
2015-06-16 20:01:25 +00:00
2015-12-23 07:13:26 +00:00