Automattic\WooCommerce\Admin\API

ProductAttributes::get_item_schema()publicWC 1.0

Get the Attribute's schema, conforming to JSON Schema.

Method of the class: ProductAttributes{}

No Hooks.

Return

Array.

Usage

$ProductAttributes = new ProductAttributes();
$ProductAttributes->get_item_schema();

ProductAttributes::get_item_schema() code WC 8.7.0

public function get_item_schema() {
	$schema = parent::get_item_schema();
	// Custom attributes substitute slugs for numeric IDs.
	$schema['properties']['id']['type'] = array( 'integer', 'string' );

	return $schema;
}