WP_Meta_Query::is_first_order_clause() WordPress Method

The WordPress function is_first_order_clause() is used to check if a given clause is the first order clause in a WP_Meta_Query object. This is useful for checking if the current clause is the first order clause within a given meta_query.

WP_Meta_Query::is_first_order_clause( array $query ) #

Determine whether a query clause is first-order.


Description

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


Top ↑

Parameters

$query

(array)(Required)Meta query arguments.


Top ↑

Return

(bool) Whether the query clause is a first-order clause.


Top ↑

Source

File: wp-includes/class-wp-meta-query.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.