WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin\API

Products::is_low_in_stock_request() private WC 1.0

Check whether the request is for products low in stock.

It matches requests with paramaters:

low_in_stock = true page = 1 fields[0] = id

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

No Hooks.

Return

true|false. Whether the request matches.

Usage

// private - for code of main (parent) class only
$result = $this->is_low_in_stock_request( $request );
$request(string) (required)
WP REST API request.

Code of Products::is_low_in_stock_request() WC 6.1.1

private function is_low_in_stock_request( $request ) {
	if (
		$request->get_param( 'low_in_stock' ) === true &&
		$request->get_param( 'page' ) === 1 &&
		is_array( $request->get_param( '_fields' ) ) &&
		count( $request->get_param( '_fields' ) ) === 1 &&
		in_array( 'id', $request->get_param( '_fields' ), true )
	) {
		return true;
	}

	return false;
}