WordPress at Your Fingertips
function is not described

WC_Shortcode_Products::set_visibility_catalog_query_args() protected WC 3.2.0

Set visibility as catalog.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->set_visibility_catalog_query_args( $query_args );
$query_args(array) (required) (passed by reference — &)
Query args.

Changelog

Since 3.2.0 Introduced.

Code of WC_Shortcode_Products::set_visibility_catalog_query_args() WC 5.9.0

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