WC_Shortcode_Products::set_visibility_search_query_args()protectedWC 3.2.0

Set visibility as search.

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

Хуков нет.

Возвращает

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

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

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

Список изменений

С версии 3.2.0 Введена.

Код WC_Shortcode_Products::set_visibility_search_query_args() WC 8.7.0

protected function set_visibility_search_query_args( &$query_args ) {
	$this->custom_visibility   = true;
	$query_args['tax_query'][] = array(
		'taxonomy'         => 'product_visibility',
		'terms'            => 'exclude-from-catalog',
		'field'            => 'name',
		'operator'         => 'IN',
		'include_children' => false,
	);
	$query_args['tax_query'][] = array(
		'taxonomy'         => 'product_visibility',
		'terms'            => 'exclude-from-search',
		'field'            => 'name',
		'operator'         => 'NOT IN',
		'include_children' => false,
	);
}