WP_Tax_Query::get_sql_clauses(): string[]
- Since
- 4.1.0
- Source
wp-includes/class-wp-tax-query.php:269
Generates SQL clauses to be appended to a main query.
Description
Called by the public WP_Tax_Query::get_sql(), this method is abstracted out to maintain parity with the other Query classes.
Return
string[]- Array containing JOIN and WHERE SQL clauses to append to the main query.
$joinstringSQL fragment to append to the main JOIN clause.$wherestringSQL fragment to append to the main WHERE clause.
Uses · 1
- WP_Tax_Query::get_sql_for_query()Generates SQL clauses for a single query array.
Used by · 1
- WP_Tax_Query::get_sql()Generates SQL clauses to be appended to a main query.
Source
protected function get_sql_clauses() { /* * $queries are passed by reference to get_sql_for_query() for recursion. * To keep $this->queries unaltered, pass a copy. */ $queries = $this->queries; $sql = $this->get_sql_for_query( $queries ); if ( ! empty( $sql['where'] ) ) { $sql['where'] = ' AND ' . $sql['where']; } return $sql; }History
Introduced in 4.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/class-wp-tax-query.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.