WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Report_Sales_By_Category::get_products_in_category() public WC 1.0

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

Это метод класса: WC_Report_Sales_By_Category{}

Возвращает

Массив.

Использование

$WC_Report_Sales_By_Category = new WC_Report_Sales_By_Category();
$WC_Report_Sales_By_Category->get_products_in_category( $category_id );
$category_id(число) (обязательный)
Category ID.

Код WC_Report_Sales_By_Category::get_products_in_category() WC 4.5.2

woocommerce/includes/admin/reports/class-wc-report-sales-by-category.php
<?php
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 ) );
}