WC_REST_System_Status_Tools_V2_Controller::get_item_schema()publicWC 1.0

Get the system status tools schema, conforming to JSON Schema.

Method of the class: WC_REST_System_Status_Tools_V2_Controller{}

No Hooks.

Return

Array.

Usage

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

WC_REST_System_Status_Tools_V2_Controller::get_item_schema() code WC 8.6.1

public function get_item_schema() {
	$schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'system_status_tool',
		'type'       => 'object',
		'properties' => array(
			'id'          => array(
				'description' => __( 'A unique identifier for the tool.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'arg_options' => array(
					'sanitize_callback' => 'sanitize_title',
				),
			),
			'name'        => array(
				'description' => __( 'Tool name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'arg_options' => array(
					'sanitize_callback' => 'sanitize_text_field',
				),
			),
			'action'      => array(
				'description' => __( 'What running the tool will do.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'arg_options' => array(
					'sanitize_callback' => 'sanitize_text_field',
				),
			),
			'description' => array(
				'description' => __( 'Tool description.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'arg_options' => array(
					'sanitize_callback' => 'sanitize_text_field',
				),
			),
			'success'     => array(
				'description' => __( 'Did the tool run successfully?', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => array( 'edit' ),
			),
			'message'     => array(
				'description' => __( 'Tool return message.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'edit' ),
				'arg_options' => array(
					'sanitize_callback' => 'sanitize_text_field',
				),
			),
		),
	);

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