FormsRoutes.php
9 months ago
HostingRoutes.php
3 months ago
IntegrationsRoutes.php
2 weeks ago
ReachRoutes.php
1 month ago
Routes.php
5 months ago
HostingRoutes.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Hostinger\Reach\Api\Routes; |
| 4 | |
| 5 | use Hostinger\Reach\Api\Handlers\HostingApiHandler; |
| 6 | |
| 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | die; |
| 9 | } |
| 10 | |
| 11 | class HostingRoutes extends Routes { |
| 12 | private HostingApiHandler $handler; |
| 13 | |
| 14 | public function __construct( HostingApiHandler $handler ) { |
| 15 | $this->handler = $handler; |
| 16 | } |
| 17 | |
| 18 | public function register_routes(): void { |
| 19 | register_rest_route( |
| 20 | HOSTINGER_REACH_PLUGIN_REST_API_BASE, |
| 21 | 'hosting/domain-details', |
| 22 | array( |
| 23 | 'methods' => 'GET', |
| 24 | 'callback' => array( $this->handler, 'get_domain_details_handler' ), |
| 25 | 'permission_callback' => array( $this, 'permission_check' ), |
| 26 | ) |
| 27 | ); |
| 28 | } |
| 29 | } |
| 30 |