diff --git a/wp-includes/date.php b/wp-includes/date.php
index fa464c6dac..df762554d0 100644
|
a
|
b
|
class WP_Date_Query { |
| 145 | 145 | * 'comment_date', 'comment_date_gmt'. |
| 146 | 146 | */ |
| 147 | 147 | public function __construct( $date_query, $default_column = 'post_date' ) { |
| | 148 | |
| | 149 | if ( empty( $date_query ) || ! is_array( $date_query ) ) { |
| | 150 | return; |
| | 151 | } |
| | 152 | |
| 148 | 153 | if ( isset( $date_query['relation'] ) && 'OR' === strtoupper( $date_query['relation'] ) ) { |
| 149 | 154 | $this->relation = 'OR'; |
| 150 | 155 | } else { |
| 151 | 156 | $this->relation = 'AND'; |
| 152 | 157 | } |
| 153 | 158 | |
| 154 | | if ( ! is_array( $date_query ) ) { |
| 155 | | return; |
| 156 | | } |
| 157 | | |
| 158 | 159 | // Support for passing time-based keys in the top level of the $date_query array. |
| 159 | | if ( ! isset( $date_query[0] ) && ! empty( $date_query ) ) { |
| | 160 | if ( ! isset( $date_query[0] ) ) { |
| 160 | 161 | $date_query = array( $date_query ); |
| 161 | 162 | } |
| 162 | 163 | |
| 163 | | if ( empty( $date_query ) ) { |
| 164 | | return; |
| 165 | | } |
| 166 | | |
| 167 | 164 | if ( ! empty( $date_query['column'] ) ) { |
| 168 | 165 | $date_query['column'] = esc_sql( $date_query['column'] ); |
| 169 | 166 | } else { |