WordPress at a glance
function is not described

WC_REST_Products_V2_Controller::get_taxonomy_terms() protected WC 1.0

Get taxonomy terms.

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

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_taxonomy_terms( $product, $taxonomy );
$product(WC_Product) (required)
Product instance.
$taxonomy(string)
Taxonomy slug.

Code of WC_REST_Products_V2_Controller::get_taxonomy_terms() WC 5.0.0

<?php
protected function get_taxonomy_terms( $product, $taxonomy = 'cat' ) {
	$terms = array();

	foreach ( wc_get_object_terms( $product->get_id(), 'product_' . $taxonomy ) as $term ) {
		$terms[] = array(
			'id'   => $term->term_id,
			'name' => $term->name,
			'slug' => $term->slug,
		);
	}

	return $terms;
}