WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

ProductCategorySchema::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: ProductCategorySchema{}

No Hooks.

Return

Array.

Usage

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

Code of ProductCategorySchema::get_item_response() WC 5.7.1

public function get_item_response( $term ) {
	$response = parent::get_item_response( $term );
	$count    = get_term_meta( $term->term_id, 'product_count_product_cat', true );

	if ( $count ) {
		$response['count'] = (int) $count;
	}

	$response['image']        = $this->image_attachment_schema->get_item_response( get_term_meta( $term->term_id, 'thumbnail_id', true ) );
	$response['review_count'] = $this->get_category_review_count( $term );
	$response['permalink']    = get_term_link( $term->term_id, 'product_cat' );

	return $response;
}