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