Automattic\WooCommerce\Blocks\BlockTypes
ProductQuery::merge_tax_queries
Merge tax_queries from various queries.
Method of the class: ProductQuery{}
No Hooks.
Returns
array.
Usage
// private - for code of main (parent) class only $result = $this->merge_tax_queries( ...$queries );
- ...$queries(array) (required)
- Query arrays to be merged.
ProductQuery::merge_tax_queries() ProductQuery::merge tax queries code WC 11.2.1
private function merge_tax_queries( ...$queries ) {
$tax_query = [];
foreach ( $queries as $query ) {
if ( ! empty( $query['tax_query'] ) ) {
$tax_query = array_merge( $tax_query, $query['tax_query'] );
}
}
return [ 'tax_query' => $tax_query ];
}