get_tax_sql() WordPress Function

The get_tax_sql() function is used to generate SQL code for retrieving taxonomy data from the WordPress database. This function is useful for developers who need to manipulate taxonomy data in their custom applications.

get_tax_sql( array $tax_query, string $primary_table, string $primary_id_column ) #

Given a taxonomy query, generates SQL to be appended to a main query.


Description

Top ↑

See also


Top ↑

Parameters

$tax_query

(array)(Required)A compact tax query

$primary_table

(string)(Required)

$primary_id_column

(string)(Required)


Top ↑

Return

(string[])


Top ↑

Source

File: wp-includes/taxonomy.php

function get_tax_sql( $tax_query, $primary_table, $primary_id_column ) {
	$tax_query_obj = new WP_Tax_Query( $tax_query );
	return $tax_query_obj->get_sql( $primary_table, $primary_id_column );
}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More