WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/27/2013 04:38:32 PM (5 years ago)
Author:
nacin
Message:

WP_Date_Query.

props Viper007Bond.
see #18694.

File:
1 edited

Legend:

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

    r25126 r25139  
    196196     */
    197197    var $meta_query = false;
     198
     199    /**
     200     * Date query container
     201     *
     202     * @since 3.7.0
     203     * @access public
     204     * @var object WP_Date_Query
     205     */
     206    var $date_query = false;
    198207
    199208    /**
     
    232241            'meta_value' => '',
    233242            'meta_query' => '',
     243            'date_query' => null, // See WP_Date_Query
    234244        );
    235245
     
    361371        }
    362372
     373        if ( ! empty( $date_query ) && is_array( $date_query ) ) {
     374            $date_query_object = new WP_Date_Query( $date_query, 'comment_date' );
     375            $where .= $date_query_object->get_sql();
     376        }
     377
    363378        $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits', 'groupby' );
    364379        $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
Note: See TracChangeset for help on using the changeset viewer.