From 6357e97cce416e3e7b69063508aee72bf1e2aadb Mon Sep 17 00:00:00 2001 From: sergeymitr Date: Mon, 23 Sep 2024 17:07:49 -0400 Subject: [PATCH] Add the version prefix to the endpoints. --- projects/plugins/jetpack/class.json-api-endpoints.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/plugins/jetpack/class.json-api-endpoints.php b/projects/plugins/jetpack/class.json-api-endpoints.php index 756a3e90c1050..a2120df0ff85f 100644 --- a/projects/plugins/jetpack/class.json-api-endpoints.php +++ b/projects/plugins/jetpack/class.json-api-endpoints.php @@ -2645,9 +2645,10 @@ public function get_amp_cache_origins( $siteurl ) { * @throws Exception The exception if something goes wrong. */ public function create_rest_route_for_endpoint() { + $version_prefix = $this->max_version ? 'v' . $this->max_version : ''; register_rest_route( static::REST_NAMESPACE, - $this->rest_route, + $version_prefix . $this->rest_route, array( 'methods' => $this->method, 'callback' => array( $this, 'rest_callback' ),