Submit
Path:
~
/
home
/
getwphos
/
www
/
techniquetechs
/
wp-content
/
plugins
/
woocommerce
/
src
/
StoreApi
/
Schemas
/
V1
/
File Content:
TermSchema.php
<?php namespace Automattic\WooCommerce\StoreApi\Schemas\V1; /** * TermSchema class. */ class TermSchema extends AbstractSchema { /** * The schema item name. * * @var string */ protected $title = 'term'; /** * The schema item identifier. * * @var string */ const IDENTIFIER = 'term'; /** * Term properties. * * @return array */ public function get_properties() { return [ 'id' => array( 'description' => __( 'Unique identifier for the resource.', 'woocommerce' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'Term name.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'slug' => array( 'description' => __( 'String based identifier for the term.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'Term description.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'parent' => array( 'description' => __( 'Parent term ID, if applicable.', 'woocommerce' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'count' => array( 'description' => __( 'Number of objects (posts of any type) assigned to the term.', 'woocommerce' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ]; } /** * Convert a term object into an object suitable for the response. * * @param \WP_Term $term Term object. * @return array */ 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, ]; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
AI
---
0755
AbstractAddressSchema.php
10716 bytes
0644
AbstractSchema.php
13143 bytes
0644
BatchSchema.php
427 bytes
0644
BillingAddressSchema.php
4569 bytes
0644
CartCouponSchema.php
3268 bytes
0644
CartExtensionsSchema.php
2259 bytes
0644
CartFeeSchema.php
2169 bytes
0644
CartItemSchema.php
7739 bytes
0644
CartSchema.php
16612 bytes
0644
CartShippingRateSchema.php
11642 bytes
0644
CheckoutOrderSchema.php
752 bytes
0644
CheckoutSchema.php
15261 bytes
0644
ErrorSchema.php
1151 bytes
0644
ImageAttachmentSchema.php
2616 bytes
0644
ItemSchema.php
11266 bytes
0644
OrderCouponSchema.php
2468 bytes
0644
OrderFeeSchema.php
2253 bytes
0644
OrderItemSchema.php
2853 bytes
0644
OrderSchema.php
13047 bytes
0644
PatternsSchema.php
673 bytes
0644
ProductAttributeSchema.php
2555 bytes
0644
ProductBrandSchema.php
3575 bytes
0644
ProductCategorySchema.php
3579 bytes
0644
ProductCollectionDataSchema.php
4281 bytes
0644
ProductReviewSchema.php
6269 bytes
0644
ProductSchema.php
33264 bytes
0644
ShippingAddressSchema.php
2906 bytes
0644
TermSchema.php
2205 bytes
0644
N4ST4R_ID | Naxtarrr