WP_Meta_Query::get_sql_for_clause

SummerySummery

Generate SQL JOIN and WHERE clauses for a first-order query clause.

Syntax

WP_Meta_Query::get_sql_for_clause( array $clause, array $parent_query, string $clause_key = '' )

DescriptionDescription

"First-order" means that it’s an array with a ‘key’ or ‘value’.

ParametersParameters

$clause

(array) (Required) Query clause (passed by reference).

$parent_query

(array) (Required) Parent query array.

$clause_key

(string) (Optional) The array key used to name the clause in the original $meta_query parameters. If not provided, a key will be generated automatically.

Default value: ''

ReturnReturn

(array) Array containing JOIN and WHERE SQL clauses to append to a first-order query.

  • 'join'
    (string) SQL fragment to append to the main JOIN clause.
  • 'where'
    (string) SQL fragment to append to the main WHERE clause.

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
4.1.0 Introduced.
Scroll to Top