diff --git a/wp-includes/class-wp-date-query.php b/wp-includes/class-wp-date-query.php index 716b44215e..2f7ef7e28c 100644 --- a/wp-includes/class-wp-date-query.php +++ b/wp-includes/class-wp-date-query.php @@ -145,25 +145,21 @@ class WP_Date_Query { * 'comment_date', 'comment_date_gmt'. */ public function __construct( $date_query, $default_column = 'post_date' ) { + if ( empty( $date_query ) || ! is_array( $date_query ) ) { + return; + } + if ( isset( $date_query['relation'] ) && 'OR' === strtoupper( $date_query['relation'] ) ) { $this->relation = 'OR'; } else { $this->relation = 'AND'; } - if ( ! is_array( $date_query ) ) { - return; - } - // Support for passing time-based keys in the top level of the $date_query array. - if ( ! isset( $date_query[0] ) && ! empty( $date_query ) ) { + if ( ! isset( $date_query[0] ) ) { $date_query = array( $date_query ); } - if ( empty( $date_query ) ) { - return; - } - if ( ! empty( $date_query['column'] ) ) { $date_query['column'] = esc_sql( $date_query['column'] ); } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index 333a2c17b9..e4c76f0ea0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45827'; +$wp_version = '5.3-alpha-45850'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.