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.
Return
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 7.7.0
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, ]; }