WordPress at Your Fingertips
function is not described

WC_Report_Sales_By_Category::get_products_in_category() public WC 1.0

Get all product ids in a category (and its children).

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

Return

Array.

Usage

$WC_Report_Sales_By_Category = new WC_Report_Sales_By_Category();
$WC_Report_Sales_By_Category->get_products_in_category( $category_id );
$category_id(int) (required)
Category ID.

Code of WC_Report_Sales_By_Category::get_products_in_category() WC 5.8.0

public function get_products_in_category( $category_id ) {
	$term_ids    = get_term_children( $category_id, 'product_cat' );
	$term_ids[]  = $category_id;
	$product_ids = get_objects_in_term( $term_ids, 'product_cat' );

	return array_unique( apply_filters( 'woocommerce_report_sales_by_category_get_products_in_category', $product_ids, $category_id ) );
}