Constructor.
Parameters
$tax_queryarrayrequired- Array of taxonomy query clauses.
relationstringOptional. The MySQL keyword used to join the clauses of the query. Accepts'AND', or'OR'. Default'AND'....$0arrayAn array of first-order clause parameters, or another fully-formed tax query.taxonomystringTaxonomy being queried. Optional when field=term_taxonomy_id.termsstring|int|arrayTerm or terms to filter by.fieldstringField to match $terms against. Accepts'term_id','slug','name', or'term_taxonomy_id'. Default:'term_id'.operatorstringMySQL operator to be used with $terms in the WHERE clause.
Accepts'AND','IN', ‘NOT IN’,'EXISTS', ‘NOT EXISTS’.
Default:'IN'.include_childrenboolOptional. Whether to include child terms.
Requires a $taxonomy. Default: true.
Source
public function __construct( $tax_query ) { if ( isset( $tax_query['relation'] ) ) { $this->relation = $this->sanitize_relation( $tax_query['relation'] ); } else { $this->relation = 'AND'; } $this->queries = $this->sanitize_query( $tax_query ); }Changelog
User Contributed Notes
You must log in before being able to contribute a note or feedback.