Automattic\WooCommerce\StoreApi\Schemas\V1
ProductSchema::prepare_product_attribute_value()
Prepare an attribute term for the response.
Метод класса: ProductSchema{}
Хуков нет.
Возвращает
Объект
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_product_attribute_value( $name, $id, $slug );
- $name(строка) (обязательный)
- Attribute term name.
- $id(int)
- Attribute term ID.
- $slug(строка)
- Attribute term slug.
По умолчанию: ''
Код ProductSchema::prepare_product_attribute_value() ProductSchema::prepare product attribute value WC 7.5.1
protected function prepare_product_attribute_value( $name, $id = 0, $slug = '' ) { return (object) [ 'id' => (int) $id, 'name' => $name, 'slug' => $slug ? $slug : $name, ]; }