WP_Date_Query::is_first_order_clause()protectedWP 4.1.0

Determines whether this is a first-order clause.

Checks to see if the current clause has any time-related keys. If so, it's first-order.

Method of the class: WP_Date_Query{}

No Hooks.


true|false. True if this is a first-order clause.


// protected - for code of main (parent) or child class
$result = $this->is_first_order_clause( $query );
$query(array) (required)
Query clause.


Since 4.1.0 Introduced.

WP_Date_Query::is_first_order_clause() code WP 6.5.4

protected function is_first_order_clause( $query ) {
	$time_keys = array_intersect( $this->time_keys, array_keys( $query ) );
	return ! empty( $time_keys );