WC_REST_Ping_V4_Controller::get_item_schemapublicWC 4.0.0

Get the ping schema, conforming to JSON Schema.

Method of the class: WC_REST_Ping_V4_Controller{}

No Hooks.

Returns

Array.

Usage

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

Changelog

Since 4.0.0 Introduced.

WC_REST_Ping_V4_Controller::get_item_schema() code WC 10.3.6

public function get_item_schema() {
	$schema = $this->get_base_schema();

	$schema['title']      = 'ping';
	$schema['properties'] = array(
		'message' => array(
			'description' => __( 'The ping response message.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view' ),
			'readonly'    => true,
		),
		'version' => array(
			'description' => __( 'The API version responding to the ping.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view' ),
			'readonly'    => true,
		),
	);

	return $schema;
}