Automattic\WooCommerce\Blocks\BlockTypes

ProductTag::set_block_query_args()protectedWC 1.0

Set args specific to this block.

Метод класса: ProductTag{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->set_block_query_args( $query_args );
$query_args(массив) (обязательный) (передается по ссылке — &)
Query args.

Код ProductTag::set_block_query_args() WC 8.7.0

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',
		);
	}
}