WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Stock

Controller::add_wp_query_filter() public WC 1.0

Add in conditional search filters for products.

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

No Hooks.

Return

String. Nothing.

Usage

$result = Controller::add_wp_query_filter( $where, $wp_query );
$where(string) (required)
Where clause used to search posts.
$wp_query(object) (required)
WP_Query object.

Code of Controller::add_wp_query_filter() WC 5.2.2

<?php
public static function add_wp_query_filter( $where, $wp_query ) {
	global $wpdb;

	$stock_status = $wp_query->get( 'stock_status' );
	if ( $stock_status ) {
		$where .= $wpdb->prepare(
			' AND wc_product_meta_lookup.stock_status = %s ',
			$stock_status
		);
	}

	if ( $wp_query->get( 'low_in_stock' ) ) {
		// We want products with stock < low stock amount, but greater than no stock amount.
		$no_stock_amount  = absint( max( get_option( 'woocommerce_notify_no_stock_amount' ), 0 ) );
		$low_stock_amount = absint( max( get_option( 'woocommerce_notify_low_stock_amount' ), 1 ) );
		$where           .= "
		AND wc_product_meta_lookup.stock_quantity IS NOT NULL
		AND wc_product_meta_lookup.stock_status = 'instock'
		AND (
			(
				low_stock_amount_meta.meta_value > ''
				AND wc_product_meta_lookup.stock_quantity <= CAST(low_stock_amount_meta.meta_value AS SIGNED)
				AND wc_product_meta_lookup.stock_quantity > {$no_stock_amount}
			)
			OR (
				(
					low_stock_amount_meta.meta_value IS NULL OR low_stock_amount_meta.meta_value <= ''
				)
				AND wc_product_meta_lookup.stock_quantity <= {$low_stock_amount}
				AND wc_product_meta_lookup.stock_quantity > {$no_stock_amount}
			)
		)";
	}

	return $where;
}