Automattic\WooCommerce\Blocks\StoreApi\Schemas
TermSchema::get_item_response() public WC 1.0
Convert a term object into an object suitable for the response.
{} Это метод класса: TermSchema{}
Хуков нет.
Возвращает
Массив
. Ничего.
Использование
$TermSchema = new TermSchema(); $TermSchema->get_item_response( $term );
- $term(\WP_Term) (обязательный)
- Term object.
Код TermSchema::get_item_response() TermSchema::get item response WC 5.2.2
public function get_item_response( $term ) {
return [
'id' => (int) $term->term_id,
'name' => $this->prepare_html_response( $term->name ),
'slug' => $term->slug,
'description' => $this->prepare_html_response( $term->description ),
'parent' => (int) $term->parent,
'count' => (int) $term->count,
];
}