WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports

DataStore::get_products_by_cat_ids() protected WC 1.0

Returns an array of products belonging to given categories.

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

No Hooks.

Return

Array|stdClass. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_products_by_cat_ids( $categories );
$categories(array) (required)
List of categories IDs.

Code of DataStore::get_products_by_cat_ids() WC 5.3.0

<?php
protected function get_products_by_cat_ids( $categories ) {
	$terms = get_terms(
		array(
			'taxonomy' => 'product_cat',
			'include'  => $categories,
		)
	);

	if ( is_wp_error( $terms ) || empty( $terms ) ) {
		return array();
	}

	$args = array(
		'category' => wc_list_pluck( $terms, 'slug' ),
		'limit'    => -1,
		'return'   => 'ids',
	);
	return wc_get_products( $args );
}