`date_query` should be a property on `WP_Comment_Query` objects.

Instead of a local variable.

Props flixos90.
Fixes #36741.

git-svn-id: https://develop.svn.wordpress.org/trunk@37354 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2016-05-03 16:14:28 +00:00
parent 1c25b93a97
commit c064ac690c
1 changed files with 3 additions and 4 deletions

View File

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