RestAPI.php
806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* RestAPI blocks setup.
*
* @copyright (c) 2021, Code Atlantic LLC.
* @package ContentControl
*/
namespace ContentControl\Controllers;
defined( 'ABSPATH' ) || exit;
use ContentControl\Base\Controller;
/**
* RestAPI function initialization.
*/
class RestAPI extends Controller {
/**
* Initiate rest api integrations.
*/
public function init() {
add_action( 'rest_api_init', [ $this, 'register_routes' ] );
}
/**
* Register Rest API routes.
*
* @return void
*/
public function register_routes() {
( new \ContentControl\RestAPI\BlockTypes() )->register_routes();
( new \ContentControl\RestAPI\License() )->register_routes();
( new \ContentControl\RestAPI\ObjectSearch() )->register_routes();
( new \ContentControl\RestAPI\Settings() )->register_routes();
}
}