WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\BlockTypes

HandpickedProducts::set_visibility_query_args() protected WC 1.0

Set visibility query args. Handpicked products will show hidden products if chosen.

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

No Hooks.

Return

null. Nothing.

Usage

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

Code of HandpickedProducts::set_visibility_query_args() WC 5.7.0

protected function set_visibility_query_args( &$query_args ) {
	if ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) ) {
		$product_visibility_terms  = wc_get_product_visibility_term_ids();
		$query_args['tax_query'][] = array(
			'taxonomy' => 'product_visibility',
			'field'    => 'term_taxonomy_id',
			'terms'    => array( $product_visibility_terms['outofstock'] ),
			'operator' => 'NOT IN',
		);
	}
}