From 36746203fb97e715d709adbc9e9ff71037a42f14 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Thu, 28 Oct 2021 12:11:36 +0100 Subject: [PATCH] Remove "experimental" from URL details REST controller and promote to `v1` namespace (#35915) * Update to v1 namespace * Update client code to utilise new namespace --- lib/class-wp-rest-url-details-controller.php | 2 +- packages/core-data/src/fetch/__experimental-fetch-url-data.js | 2 +- phpunit/class-wp-rest-url-details-controller-test.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/class-wp-rest-url-details-controller.php b/lib/class-wp-rest-url-details-controller.php index 09c2b2195e2d4e..69fc1bb9847658 100644 --- a/lib/class-wp-rest-url-details-controller.php +++ b/lib/class-wp-rest-url-details-controller.php @@ -19,7 +19,7 @@ class WP_REST_URL_Details_Controller extends WP_REST_Controller { * Constructs the controller. */ public function __construct() { - $this->namespace = '__experimental'; + $this->namespace = 'wp-block-editor/v1'; $this->rest_base = 'url-details'; } diff --git a/packages/core-data/src/fetch/__experimental-fetch-url-data.js b/packages/core-data/src/fetch/__experimental-fetch-url-data.js index c3b3a59b2d51ac..02bebeeeaac91b 100644 --- a/packages/core-data/src/fetch/__experimental-fetch-url-data.js +++ b/packages/core-data/src/fetch/__experimental-fetch-url-data.js @@ -45,7 +45,7 @@ const CACHE = new Map(); * @return {Promise< WPRemoteUrlData[] >} Remote URL data. */ const fetchUrlData = async ( url, options = {} ) => { - const endpoint = '/__experimental/url-details'; + const endpoint = '/wp-block-editor/v1/url-details'; const args = { url: prependHTTP( url ), diff --git a/phpunit/class-wp-rest-url-details-controller-test.php b/phpunit/class-wp-rest-url-details-controller-test.php index 0ac2f8c8112866..901e83052356ec 100644 --- a/phpunit/class-wp-rest-url-details-controller-test.php +++ b/phpunit/class-wp-rest-url-details-controller-test.php @@ -20,7 +20,7 @@ class WP_REST_URL_Details_Controller_Test extends WP_Test_REST_Controller_Testca protected static $admin_id; protected static $subscriber_id; - protected static $route = '/__experimental/url-details'; + protected static $route = '/wp-block-editor/v1/url-details'; protected static $url_placeholder = 'https://placeholder-site.com'; protected static $request_args = array();