summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php')
-rw-r--r--plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php b/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php
index 8d78d005..fa844b84 100644
--- a/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php
+++ b/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php
@@ -47,6 +47,7 @@ class Jetpack_Core_Json_Api_Endpoints {
// Load API endpoints
require_once JETPACK__PLUGIN_DIR . '_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php';
+ require_once JETPACK__PLUGIN_DIR . '_inc/lib/core-api/class.jetpack-core-api-site-endpoints.php';
self::$user_permissions_error_msg = esc_html__(
'You do not have the correct user permissions to perform this action.
@@ -62,6 +63,7 @@ class Jetpack_Core_Json_Api_Endpoints {
$module_list_endpoint = new Jetpack_Core_API_Module_List_Endpoint();
$module_data_endpoint = new Jetpack_Core_API_Module_Data_Endpoint();
$module_toggle_endpoint = new Jetpack_Core_API_Module_Toggle_Endpoint( new Jetpack_IXR_Client() );
+ $site_endpoint = new Jetpack_Core_API_Site_Endpoint();
register_rest_route( 'jetpack/v4', '/jitm', array(
'methods' => WP_REST_Server::READABLE,
@@ -114,6 +116,13 @@ class Jetpack_Core_Json_Api_Endpoints {
'permission_callback' => __CLASS__ . '::view_admin_page_permission_check',
) );
+ // Get current site data
+ register_rest_route( 'jetpack/v4', '/site/features', array(
+ 'methods' => WP_REST_Server::READABLE,
+ 'callback' => array( $site_endpoint, 'get_features' ),
+ 'permission_callback' => array( $site_endpoint , 'can_request' ),
+ ) );
+
// Confirm that a site in identity crisis should be in staging mode
register_rest_route( 'jetpack/v4', '/identity-crisis/confirm-safe-mode', array(
'methods' => WP_REST_Server::EDITABLE,