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