WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

TermSchema::get_item_response() public WC 1.0

Convert a term object into an object suitable for the response.

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

No Hooks.

Return

Array.

Usage

$TermSchema = new TermSchema();
$TermSchema->get_item_response( $term );
$term(\WP_Term) (required)
Term object.

Code of TermSchema::get_item_response() WC 5.7.1

public function get_item_response( $term ) {
	return [
		'id'          => (int) $term->term_id,
		'name'        => $this->prepare_html_response( $term->name ),
		'slug'        => $term->slug,
		'description' => $this->prepare_html_response( $term->description ),
		'parent'      => (int) $term->parent,
		'count'       => (int) $term->count,
	];
}