Docs: Add a comment for stripping the leading AND from SQL clauses in some query classes.

Follow-up to [30084], [34529], [34542], [36598], [37477], [37572], [43010].

See #55646.

git-svn-id: https://develop.svn.wordpress.org/trunk@53503 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-06-14 16:15:52 +00:00
parent 18d8db3078
commit f3441e37ed
3 changed files with 22 additions and 6 deletions

View File

@@ -911,7 +911,9 @@ class WP_Comment_Query {
}
if ( ! empty( $this->query_vars['date_query'] ) && is_array( $this->query_vars['date_query'] ) ) {
$this->date_query = new WP_Date_Query( $this->query_vars['date_query'], 'comment_date' );
$this->date_query = new WP_Date_Query( $this->query_vars['date_query'], 'comment_date' );
// Strip leading 'AND'.
$this->sql_clauses['where']['date_query'] = preg_replace( '/^\s*AND\s*/', '', $this->date_query->get_sql() );
}