# content-control/2.0.4/classes/Controllers/RestAPI.php

Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks &amp; More, version 2.0.4. 36 lines.

- Page: https://pluginprobe.com/plugins/content-control/2.0.4/code/classes/Controllers/RestAPI.php
- Raw: https://pluginprobe.com/plugins/content-control/2.0.4/raw/classes/Controllers/RestAPI.php
- Modified: 2023-09-18T01:47:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/content-control/2.0.4/code/classes/Controllers/RestAPI.php#L10-L20`.

```php
<?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.
	 */
	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();
	}
}

```
