WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

ProductAttributeSchema::get_item_response() public WC 1.0

Convert an attribute object into an object suitable for the response.

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

No Hooks.

Return

Array.

Usage

$ProductAttributeSchema = new ProductAttributeSchema();
$ProductAttributeSchema->get_item_response( $attribute );
$attribute(object) (required)
Attribute object.

Code of ProductAttributeSchema::get_item_response() WC 5.8.0

public function get_item_response( $attribute ) {
	return [
		'id'           => (int) $attribute->id,
		'name'         => $this->prepare_html_response( $attribute->name ),
		'taxonomy'     => $attribute->slug,
		'type'         => $attribute->type,
		'order'        => $attribute->order_by,
		'has_archives' => $attribute->has_archives,
		'count'        => (int) \wp_count_terms( $attribute->slug ),
	];
}