Given a taxonomy query, generates SQL to be appended to a main query.
Description
See also
Parameters
$tax_query
arrayrequired- A compact tax query
$primary_table
stringrequired$primary_id_column
stringrequired
Source
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 );
}
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |
Get SQL query part for taxonomy
Output would be something like: