WordPress.org

Make WordPress Core

Changeset 37354


Ignore:
Timestamp:
05/03/2016 04:14:28 PM (4 years ago)
Author:
boonebgorges
Message:

date_query should be a property on WP_Comment_Query objects.

Instead of a local variable.

Props flixos90.
Fixes #36741.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-comment-query.php

    r36834 r37354  
    834834        }
    835835
    836         $date_query = $this->query_vars['date_query'];
    837         if ( ! empty( $date_query ) && is_array( $date_query ) ) {
    838             $date_query_object = new WP_Date_Query( $date_query, 'comment_date' );
    839             $this->sql_clauses['where']['date_query'] = preg_replace( '/^\s*AND\s*/', '', $date_query_object->get_sql() );
     836        if ( ! empty( $this->query_vars['date_query'] ) && is_array( $this->query_vars['date_query'] ) ) {
     837            $this->date_query = new WP_Date_Query( $this->query_vars['date_query'], 'comment_date' );
     838            $this->sql_clauses['where']['date_query'] = preg_replace( '/^\s*AND\s*/', '', $this->date_query->get_sql() );
    840839        }
    841840
Note: See TracChangeset for help on using the changeset viewer.