wp-includes/class-wp-date-query.php:148Constructor.
$date_queryarray$comparestringdefault: '='
$relationstring
$beforestring|array
$yearstringdefault: empty. Accepts any four-digit year
$monthstringdefault: (string:empty)|(array:1). Accepts numbers 1-12
$daystring
$yearstringdefault: empty
$monthstringdefault: (string:empty)|(array:12)
$daystringdefault: is the value of top-level $column
$comparestringdefault: '='
$inclusivebooldefault: false
$yearint|int[]default: empty
$monthint|int[]default: empty
$weekint|int[]default: empty
$dayofyearint|int[]
$dayint|int[]default: empty
$dayofweekint|int[]default: empty
$dayofweek_isoint|int[]default: empty
$hourint|int[]default: empty
$minuteint|int[]default: empty
$secondint|int[]default: empty. } }
$default_columnstringoptional'post_date' public function __construct( $date_query, $default_column = 'post_date' ) { if ( empty( $date_query ) || ! is_array( $date_query ) ) { return; } if ( isset( $date_query['relation'] ) ) { $this->relation = $this->sanitize_relation( $date_query['relation'] ); } else { $this->relation = 'AND'; } // Support for passing time-based keys in the top level of the $date_query array. if ( ! isset( $date_query[0] ) ) { $date_query = array( $date_query ); } if ( ! empty( $date_query['column'] ) ) { $date_query['column'] = esc_sql( $date_query['column'] ); } else { $date_query['column'] = esc_sql( $default_column ); } $this->column = $this->validate_column( $this->column ); $this->compare = $this->get_compare( $date_query ); $this->queries = $this->sanitize_query( $date_query ); }Introduced in 4.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-date-query.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.