Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
56.25% |
9 / 16 |
|
100.00% |
1 / 1 |
CRAP | n/a |
0 / 0 |
|
| wpcomsh_rest_api_init | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Custom REST API endpoints for wpcomsh. |
| 4 | * |
| 5 | * @package endpoints |
| 6 | */ |
| 7 | |
| 8 | // Require endpoint files. |
| 9 | require_once __DIR__ . '/class-marketplace-webhook-response.php'; |
| 10 | require_once __DIR__ . '/class-backup-import-response.php'; |
| 11 | require_once __DIR__ . '/class-rest-api-code-deployment-logs-controller.php'; |
| 12 | require_once __DIR__ . '/rest-api-gutenberg-version.php'; |
| 13 | require_once __DIR__ . '/rest-api-logout.php'; |
| 14 | require_once __DIR__ . '/rest-api-reconnect.php'; |
| 15 | |
| 16 | /** |
| 17 | * Initialize REST API. |
| 18 | */ |
| 19 | function wpcomsh_rest_api_init() { |
| 20 | $controller = new Marketplace_Webhook_Response(); |
| 21 | $controller->register_routes(); |
| 22 | |
| 23 | $controller = new Backup_Import_Response(); |
| 24 | $controller->register_routes(); |
| 25 | |
| 26 | // Code deployment logs endpoints |
| 27 | $controller = new Rest_Api_Code_Deployment_Logs_Controller(); |
| 28 | $controller->register_routes(); |
| 29 | |
| 30 | wpcomsh_rest_api_gutenberg_version_init(); |
| 31 | wpcomsh_rest_api_logout_init(); |
| 32 | wpcomsh_rest_api_reconnect_init(); |
| 33 | } |
| 34 | add_action( 'rest_api_init', 'wpcomsh_rest_api_init' ); |