| @@ 49-59 (lines=11) @@ | ||
| 46 | /**  | 
                                |
| 47 | * Register the routes for sales reports.  | 
                                |
| 48 | */  | 
                                |
| 49 | 	public function register_routes() { | 
                                |
| 50 | register_rest_route( $this->namespace, '/' . $this->rest_base, array(  | 
                                |
| 51 | array(  | 
                                |
| 52 | 'methods' => WP_REST_Server::READABLE,  | 
                                |
| 53 | 'callback' => array( $this, 'get_items' ),  | 
                                |
| 54 | 'permission_callback' => array( $this, 'get_items_permissions_check' ),  | 
                                |
| 55 | 'args' => $this->get_collection_params(),  | 
                                |
| 56 | ),  | 
                                |
| 57 | 'schema' => array( $this, 'get_public_item_schema' ),  | 
                                |
| 58 | ) );  | 
                                |
| 59 | }  | 
                                |
| 60 | ||
| 61 | /**  | 
                                |
| 62 | * Check whether a given request has permission to read report.  | 
                                |
| @@ 42-52 (lines=11) @@ | ||
| 39 | /**  | 
                                |
| 40 | * Register the routes for reports.  | 
                                |
| 41 | */  | 
                                |
| 42 | 	public function register_routes() { | 
                                |
| 43 | register_rest_route( $this->namespace, '/' . $this->rest_base, array(  | 
                                |
| 44 | array(  | 
                                |
| 45 | 'methods' => WP_REST_Server::READABLE,  | 
                                |
| 46 | 'callback' => array( $this, 'get_items' ),  | 
                                |
| 47 | 'permission_callback' => array( $this, 'get_items_permissions_check' ),  | 
                                |
| 48 | 'args' => $this->get_collection_params(),  | 
                                |
| 49 | ),  | 
                                |
| 50 | 'schema' => array( $this, 'get_public_item_schema' ),  | 
                                |
| 51 | ) );  | 
                                |
| 52 | }  | 
                                |
| 53 | ||
| 54 | /**  | 
                                |
| 55 | * Check whether a given request has permission to read reports.  | 
                                |
| @@ 34-43 (lines=10) @@ | ||
| 31 | * Register routes.  | 
                                |
| 32 | * @since 2.7.0  | 
                                |
| 33 | */  | 
                                |
| 34 | 	public function register_routes() { | 
                                |
| 35 | register_rest_route( $this->namespace, '/' . $this->rest_base, array(  | 
                                |
| 36 | array(  | 
                                |
| 37 | 'methods' => WP_REST_Server::READABLE,  | 
                                |
| 38 | 'callback' => array( $this, 'get_items' ),  | 
                                |
| 39 | 'permission_callback' => array( $this, 'get_items_permissions_check' ),  | 
                                |
| 40 | ),  | 
                                |
| 41 | 'schema' => array( $this, 'get_public_item_schema' ),  | 
                                |
| 42 | ) );  | 
                                |
| 43 | }  | 
                                |
| 44 | ||
| 45 | /**  | 
                                |
| 46 | * Get all settings groups items.  | 
                                |