WP_Meta_Query::is_first_order_clause()protectedWP 4.1.0

Determines whether a query clause is first-order.

A first-order meta query clause is one that has either a 'key' or a 'value' array key.

Method of the class: WP_Meta_Query{}

No Hooks.

Return

true|false. Whether the query clause is a first-order clause.

Usage

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

Changelog

Since 4.1.0 Introduced.

WP_Meta_Query::is_first_order_clause() code WP 6.5.2

protected function is_first_order_clause( $query ) {
	return isset( $query['key'] ) || isset( $query['value'] );
}