Automattic\WooCommerce\Admin\API

Plugins::get_item_schema()publicWC 1.0

Get the schema, conforming to JSON Schema.

Method of the class: Plugins{}

No Hooks.

Return

Array.

Usage

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

Plugins::get_item_schema() code WC 8.6.1

public function get_item_schema() {
	$schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'plugins',
		'type'       => 'object',
		'properties' => array(
			'slug'   => array(
				'description' => __( 'Plugin slug.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'name'   => array(
				'description' => __( 'Plugin name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'status' => array(
				'description' => __( 'Plugin status.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		),
	);

	return $this->add_additional_fields_schema( $schema );
}