woocommerce/includes/api/class-wc-rest-reports-contr...

73 lines
1.6 KiB
PHP
Raw Normal View History

2016-02-17 19:29:09 +00:00
<?php
/**
* REST API Reports controller
*
* Handles requests to the reports endpoint.
*
2018-03-06 18:04:58 +00:00
* @package WooCommerce/API
* @since 2.6.0
2016-02-17 19:29:09 +00:00
*/
2018-03-06 18:04:58 +00:00
defined( 'ABSPATH' ) || exit;
2016-02-17 19:29:09 +00:00
/**
* REST API Reports controller class.
*
* @package WooCommerce/API
2018-09-05 12:24:02 +00:00
* @extends WC_REST_Reports_V2_Controller
2016-02-17 19:29:09 +00:00
*/
2018-09-05 12:24:02 +00:00
class WC_REST_Reports_Controller extends WC_REST_Reports_V2_Controller {
2016-02-17 19:29:09 +00:00
/**
* Endpoint namespace.
*
* @var string
*/
2018-05-17 10:44:46 +00:00
protected $namespace = 'wc/v3';
2018-09-05 12:36:19 +00:00
/**
* Get reports list.
*
* @since 3.5.0
* @return array
*/
protected function get_reports() {
$reports = parent::get_reports();
$reports[] = array(
'slug' => 'orders/totals',
'description' => __( 'Orders totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
$reports[] = array(
'slug' => 'products/totals',
2018-09-18 15:14:17 +00:00
'description' => __( 'Products totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
$reports[] = array(
'slug' => 'customers/totals',
'description' => __( 'Customers totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
$reports[] = array(
'slug' => 'coupons/totals',
'description' => __( 'Coupons totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
$reports[] = array(
'slug' => 'reviews/totals',
'description' => __( 'Reviews totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
$reports[] = array(
'slug' => 'categories/totals',
'description' => __( 'Categories totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
$reports[] = array(
'slug' => 'tags/totals',
'description' => __( 'Tags totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
$reports[] = array(
'slug' => 'attributes/totals',
'description' => __( 'Attributes totals.', 'woocommerce' ),
2018-09-05 12:36:19 +00:00
);
return $reports;
}
2016-02-17 19:29:09 +00:00
}