WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\BlockTypes

ProductsByAttribute::set_block_query_args() protected WC 1.0

Set args specific to this block

{} It's a method of the class: ProductsByAttribute{}

No Hooks.

Return

null. Nothing.

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.

Code of ProductsByAttribute::set_block_query_args() WC 5.7.1

protected function set_block_query_args( &$query_args ) {
	if ( ! empty( $this->attributes['attributes'] ) ) {
		$taxonomy = sanitize_title( $this->attributes['attributes'][0]['attr_slug'] );
		$terms    = wp_list_pluck( $this->attributes['attributes'], 'id' );

		$query_args['tax_query'][] = array(
			'taxonomy' => $taxonomy,
			'terms'    => array_map( 'absint', $terms ),
			'field'    => 'term_id',
			'operator' => 'all' === $this->attributes['attrOperator'] ? 'AND' : 'IN',
		);
	}
}