Automattic\WooCommerce\StoreApi\Schemas\V1
TermSchema::get_item_response
Convert a term object into an object suitable for the response.
Method of the class: TermSchema{}
No Hooks.
Returns
Array.
Usage
$TermSchema = new TermSchema(); $TermSchema->get_item_response( $term );
- $term(WP_Term) (required)
- Term object.
TermSchema::get_item_response() TermSchema::get item response code WC 10.8.1
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,
];
}