WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

ProductSchema::prepare_product_attribute_value() protected WC 1.0

Prepare an attribute term for the response.

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

No Hooks.

Return

Object.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_product_attribute_value( $name, $id, $slug );
$name(string) (required)
Attribute term name.
$id(int)
Attribute term ID.
$slug(string)
Attribute term slug.
Default: ''

Code of ProductSchema::prepare_product_attribute_value() WC 5.7.0

protected function prepare_product_attribute_value( $name, $id = 0, $slug = '' ) {
	return (object) [
		'id'   => (int) $id,
		'name' => $name,
		'slug' => $slug ? $slug : $name,
	];
}