WP_Meta_Query::has_or_relation() WordPress Method

The WP_Meta_Query::has_or_relation() method is used to check if the current meta query has an OR relation.

WP_Meta_Query::has_or_relation() #

Checks whether the current query has any OR relations.


Description

In some cases, the presence of an OR relation somewhere in the query will require the use of a DISTINCT or GROUP BY keyword in the SELECT clause. The current method can be used in these cases to determine whether such a clause is necessary.


Top ↑

Return

(bool) True if the query contains any OR relations, otherwise false.


Top ↑

Source

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

	public function has_or_relation() {
		return $this->has_or_relation;
	}

Top ↑

Changelog

Changelog
VersionDescription
4.3.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.