WP_Meta_Query::find_compatible_table_alias

SummerySummery

Identify an existing table alias that is compatible with the current query clause.

Syntax

WP_Meta_Query::find_compatible_table_alias( array $clause, array $parent_query )

DescriptionDescription

We avoid unnecessary table joins by allowing each clause to look for an existing table alias that is compatible with the query that it needs to perform.

An existing alias is compatible if (a) it is a sibling of $clause (ie, it’s under the scope of the same relation), and (b) the combination of operator and relation between the clauses allows for a shared table join. In the case of WP_Meta_Query, this only applies to ‘IN’ clauses that are connected by the relation ‘OR’.

ParametersParameters

$clause

(array) (Required) Query clause.

$parent_query

(array) (Required) Parent query of $clause.

ReturnReturn

(string|bool) Table alias if found, otherwise false.

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
4.1.0 Introduced.
Scroll to Top