mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 03:34:33 +00:00
WP_Date_Query.
props Viper007Bond. see #18694. git-svn-id: https://develop.svn.wordpress.org/trunk@25139 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -196,6 +196,15 @@ class WP_Comment_Query {
|
||||
*/
|
||||
var $meta_query = false;
|
||||
|
||||
/**
|
||||
* Date query container
|
||||
*
|
||||
* @since 3.7.0
|
||||
* @access public
|
||||
* @var object WP_Date_Query
|
||||
*/
|
||||
var $date_query = false;
|
||||
|
||||
/**
|
||||
* Execute the query
|
||||
*
|
||||
@@ -231,6 +240,7 @@ class WP_Comment_Query {
|
||||
'meta_key' => '',
|
||||
'meta_value' => '',
|
||||
'meta_query' => '',
|
||||
'date_query' => null, // See WP_Date_Query
|
||||
);
|
||||
|
||||
$groupby = '';
|
||||
@@ -360,6 +370,11 @@ class WP_Comment_Query {
|
||||
$groupby = "{$wpdb->comments}.comment_ID";
|
||||
}
|
||||
|
||||
if ( ! empty( $date_query ) && is_array( $date_query ) ) {
|
||||
$date_query_object = new WP_Date_Query( $date_query, 'comment_date' );
|
||||
$where .= $date_query_object->get_sql();
|
||||
}
|
||||
|
||||
$pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits', 'groupby' );
|
||||
$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
|
||||
foreach ( $pieces as $piece )
|
||||
|
||||
Reference in New Issue
Block a user