给定分类查询,生成要附加到主查询的SQL。

原型

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

参数

$tax_query (array) (Required) 紧凑的税务查询

$primary_table (string) (Required)

$primary_id_column (string) (Required)

返回值

(array)  

源文件

路径:wp-includes/taxonomy.php

<?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 );
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/get_tax_sql/