| 1 |
<?php |
| 2 |
/** |
| 3 |
* API Settings Controller |
| 4 |
* |
| 5 |
* @package Parsely |
| 6 |
* @since 3.17.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
declare(strict_types=1); |
| 10 |
|
| 11 |
namespace Parsely\REST_API\Settings; |
| 12 |
|
| 13 |
use Parsely\REST_API\REST_API_Controller; |
| 14 |
|
| 15 |
/** |
| 16 |
* The Settings API Controller. |
| 17 |
* |
| 18 |
* Used to define the namespace, version, and endpoints for the Settings API. |
| 19 |
* |
| 20 |
* @since 3.17.0 |
| 21 |
*/ |
| 22 |
class Settings_Controller extends REST_API_Controller { |
| 23 |
/** |
| 24 |
* Gets the prefix for this API route. |
| 25 |
* |
| 26 |
* @since 3.17.0 |
| 27 |
* |
| 28 |
* @return string The namespace. |
| 29 |
*/ |
| 30 |
public static function get_route_prefix(): string { |
| 31 |
return 'settings'; |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Initializes the Settings API endpoints. |
| 36 |
* |
| 37 |
* @since 3.17.0 |
| 38 |
*/ |
| 39 |
public function init(): void { |
| 40 |
$endpoints = array( |
| 41 |
new Endpoint_Dashboard_Widget_Settings( $this ), |
| 42 |
new Endpoint_Editor_Sidebar_Settings( $this ), |
| 43 |
new Endpoint_Traffic_Boost_Settings( $this ), |
| 44 |
new Endpoint_Headline_Testing_Settings( $this ), |
| 45 |
); |
| 46 |
|
| 47 |
$this->register_endpoints( $endpoints ); |
| 48 |
} |
| 49 |
} |
| 50 |
|