On this page
WP_Tax_Query::get_sql( string $primary_table, string $primary_id_column ): string[]
Generates SQL clauses to be appended to a main query.
Parameters
$primary_tablestring Required-
Database table where the object being filtered is stored (eg wp_users).
$primary_id_columnstring Required-
ID column for the filtered object in $primary_table.
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.
Source
File: wp-includes/class-wp-tax-query.php. View all references
public function get_sql( $primary_table, $primary_id_column ) {
$this->primary_table = $primary_table;
$this->primary_id_column = $primary_id_column;
return $this->get_sql_clauses();
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Tax_Query::get_sql_clauses() wp-includes/class-wp-tax-query.php | Generates SQL clauses to be appended to a main query. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_tax_query/get_sql