WC_REST_Report_Orders_Totals_Controller::get_item_schema()publicWC 1.0

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

Метод класса: WC_REST_Report_Orders_Totals_Controller{}

Хуков нет.

Возвращает

Массив.

Использование

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

Код WC_REST_Report_Orders_Totals_Controller::get_item_schema() WC 8.7.0

public function get_item_schema() {
	$schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'report_order_total',
		'type'       => 'object',
		'properties' => array(
			'slug'  => array(
				'description' => __( 'An alphanumeric identifier for the resource.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'name'  => array(
				'description' => __( 'Order status name.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'total' => array(
				'description' => __( 'Amount of orders.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
		),
	);

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