PluginProbe
WooCommerce / 11.1.0-rc.2
WooCommerce v11.1.0-rc.2
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / src / Admin / API / Data.php
Data.php
47 lines 939 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * REST API Data Controller
4 *
5 * Handles requests to /data
6 */
7
8 namespace Automattic\WooCommerce\Admin\API;
9
10 defined( 'ABSPATH' ) || exit;
11
12 /**
13 * Data controller.
14 *
15 * @internal
16 * @extends WC_REST_Data_Controller
17 */
18 class Data extends \WC_REST_Data_Controller {
19
20 /**
21 * Endpoint namespace.
22 *
23 * @var string
24 */
25 protected $namespace = 'wc-analytics';
26
27 /**
28 * Return the list of data resources.
29 *
30 * @param WP_REST_Request $request Request data.
31 * @return WP_Error|WP_REST_Response
32 */
33 public function get_items( $request ) {
34 $response = parent::get_items( $request );
35 $response->data[] = $this->prepare_response_for_collection(
36 $this->prepare_item_for_response(
37 (object) array(
38 'slug' => 'download-ips',
39 'description' => __( 'An endpoint used for searching download logs for a specific IP address.', 'woocommerce' ),
40 ),
41 $request
42 )
43 );
44 return $response;
45 }
46 }
47