PluginProbe
Shiprocket / trunk
Shiprocket vtrunk
trunk 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
shiprocket / includes / api / class-shiprocket-woocommerce-api.php

class-shiprocket-woocommerce-api.php in Shiprocket trunk, at includes/api/class-shiprocket-woocommerce-api.php

43 lines 842 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Handles requests to the /wc/shiprocket/v1/.
4 *
5 * @author Shiprocket
6 *
7 * @category API
8 * @package Shiprocket
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly.
13 }
14
15 /**
16 * Shipment Tracking Main Class.
17 */
18 if ( ! class_exists( 'Shiprocket_Woocommerce_Api' ) ) {
19 /**
20 * Holds Shiprocket API Methods.
21 */
22 class Shiprocket_Woocommerce_Api {
23
24 /**
25 * Constructor of Shiprocket_Woocommerce_Api class.
26 */
27 public function __construct() {
28 add_action( 'rest_api_init', array( $this, 'user_list_api' ), 100 );
29 }
30
31 /**
32 * Initialize rest api for tracking.
33 */
34 public function user_list_api() {
35 if ( ! class_exists( 'Shiprocket_User_List_API' ) ) {
36 require_once 'class-shiprocket-user-list-api.php';
37 }
38 $obj = new Shiprocket_User_List_API();
39 $obj->register_routes();
40 }
41 }
42 }
43