Automattic\WooCommerce\Blocks\BlockTypes
ProductTag::set_block_query_args()
Set args specific to this block.
Method of the class: ProductTag{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->set_block_query_args( $query_args );
- $query_args(array) (required) (passed by reference — &)
- Query args.
ProductTag::set_block_query_args() ProductTag::set block query args code WC 8.6.1
protected function set_block_query_args( &$query_args ) { if ( ! empty( $this->attributes['tags'] ) ) { $query_args['tax_query'][] = array( 'taxonomy' => 'product_tag', 'terms' => array_map( 'absint', $this->attributes['tags'] ), 'field' => 'term_id', 'operator' => isset( $this->attributes['tagOperator'] ) && 'any' === $this->attributes['tagOperator'] ? 'IN' : 'AND', ); } }