WordPress at a glance
function is not described

WP_Tax_Query::get_sql() public WP 3.1.0

Generates SQL clauses to be appended to a main query.

{} It's a method of the class: WP_Tax_Query{}

No Hooks.


Array. Array containing JOIN and WHERE SQL clauses to append to the main query.


$WP_Tax_Query = new WP_Tax_Query();
$WP_Tax_Query->get_sql( $primary_table, $primary_id_column );
$primary_table(string) (required)
Database table where the object being filtered is stored (eg wp_users).
$primary_id_column(string) (required)
ID column for the filtered object in $primary_table.


Since 3.1.0 Introduced.

Code of WP_Tax_Query::get_sql() WP 5.7

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();