Automattic\WooCommerce\Admin\API\Reports\Products

Controller::get_categories()protectedWC 1.0

Get categories column export value.

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

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_categories( $category_ids );
$category_ids(array) (required)
Category IDs from report row.

Code of Controller::get_categories() WC 6.8.2

protected function get_categories( $category_ids ) {
	$category_names = get_terms(
		array(
			'taxonomy' => 'product_cat',
			'include'  => $category_ids,
			'fields'   => 'names',
		)
	);

	return implode( ', ', $category_names );
}