Automattic\WooCommerce\Blocks\StoreApi\Schemas
ProductAttributeSchema::get_item_response() public WC 1.0
Convert an attribute object into an object suitable for the response.
{} Это метод класса: ProductAttributeSchema{}
Хуков нет.
Возвращает
Массив.
Использование
$ProductAttributeSchema = new ProductAttributeSchema(); $ProductAttributeSchema->get_item_response( $attribute );
- $attribute(объект) (обязательный)
- Attribute object.
Код ProductAttributeSchema::get_item_response() ProductAttributeSchema::get item response WC 5.0.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 ),
];
}