diff --git a/lib/class-wp-rest-menus-controller.php b/lib/class-wp-rest-menus-controller.php index b6452e1770d2f..3e839c2c958af 100644 --- a/lib/class-wp-rest-menus-controller.php +++ b/lib/class-wp-rest-menus-controller.php @@ -293,7 +293,7 @@ protected function prepare_links( $term ) { $locations = $this->get_menu_locations( $term->term_id ); $rest_base = 'menu-locations'; foreach ( $locations as $location ) { - $url = rest_url( sprintf( '__experimental/%s/%s', $rest_base, $location ) ); + $url = rest_url( sprintf( 'wp/v2/%s/%s', $rest_base, $location ) ); $links['https://api.w.org/menu-location'][] = array( 'href' => $url, 'embeddable' => true, diff --git a/packages/e2e-tests/specs/experiments/fixtures/menu-items-response-fixture.json b/packages/e2e-tests/specs/experiments/fixtures/menu-items-response-fixture.json index edee5ac96a11f..16568b4c5464f 100644 --- a/packages/e2e-tests/specs/experiments/fixtures/menu-items-response-fixture.json +++ b/packages/e2e-tests/specs/experiments/fixtures/menu-items-response-fixture.json @@ -16,19 +16,25 @@ "parent": 0, "menu_order": 1, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/94" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/94" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -45,22 +51,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/94" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/94" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/94" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/94" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/94" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/94" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/94" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/94" } ], "curies": [ @@ -89,19 +95,25 @@ "parent": 0, "menu_order": 2, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/95" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/95" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -125,22 +137,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/95" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/95" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/95" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/95" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/95" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/95" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/95" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/95" } ], "curies": [ @@ -169,19 +181,25 @@ "parent": 95, "menu_order": 3, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/96" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/96" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -205,22 +223,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/96" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/96" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/96" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/96" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/96" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/96" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/96" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/96" } ], "curies": [ @@ -249,19 +267,25 @@ "parent": 0, "menu_order": 4, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/97" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/97" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -285,22 +309,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/97" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/97" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/97" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/97" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/97" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/97" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/97" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/97" } ], "curies": [ @@ -329,19 +353,25 @@ "parent": 97, "menu_order": 5, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/98" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/98" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -365,22 +395,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/98" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/98" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/98" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/98" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/98" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/98" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/98" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/98" } ], "curies": [ @@ -409,19 +439,25 @@ "parent": 98, "menu_order": 6, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/99" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/99" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -445,22 +481,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/99" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/99" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/99" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/99" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/99" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/99" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/99" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/99" } ], "curies": [ @@ -489,19 +525,25 @@ "parent": 99, "menu_order": 7, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/100" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/100" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -525,22 +567,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/100" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/100" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/100" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/100" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/100" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/100" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/100" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/100" } ], "curies": [ @@ -569,19 +611,25 @@ "parent": 100, "menu_order": 8, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/101" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/101" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -605,22 +653,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/101" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/101" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/101" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/101" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/101" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/101" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/101" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/101" } ], "curies": [ @@ -649,19 +697,25 @@ "parent": 0, "menu_order": 9, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/102" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/102" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -685,22 +739,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/102" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/102" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/102" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/102" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/102" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/102" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/102" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/102" } ], "curies": [ @@ -729,19 +783,25 @@ "parent": 0, "menu_order": 10, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/103" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/103" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -765,22 +825,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/103" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/103" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/103" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/103" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/103" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/103" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/103" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/103" } ], "curies": [ @@ -809,19 +869,25 @@ "parent": 0, "menu_order": 11, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/104" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/104" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -845,22 +911,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/104" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/104" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/104" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/104" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/104" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/104" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/104" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/104" } ], "curies": [ @@ -889,19 +955,25 @@ "parent": 104, "menu_order": 12, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/105" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/105" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -925,22 +997,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/105" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/105" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/105" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/105" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/105" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/105" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/105" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/105" } ], "curies": [ @@ -969,19 +1041,25 @@ "parent": 105, "menu_order": 13, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/106" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/106" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -1005,22 +1083,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/106" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/106" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/106" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/106" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/106" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/106" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/106" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/106" } ], "curies": [ @@ -1049,19 +1127,25 @@ "parent": 106, "menu_order": 14, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/107" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/107" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -1085,22 +1169,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/107" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/107" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/107" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/107" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/107" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/107" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/107" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/107" } ], "curies": [ @@ -1129,19 +1213,25 @@ "parent": 0, "menu_order": 15, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/108" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/108" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -1158,22 +1248,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/108" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/108" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/108" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/108" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/108" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/108" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/108" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/108" } ], "curies": [ @@ -1202,19 +1292,25 @@ "parent": 108, "menu_order": 16, "target": "", - "classes": [ "" ], - "xfn": [ "" ], + "classes": [ + "" + ], + "xfn": [ + "" + ], "meta": [], - "menus": [ 23 ], + "menus": [ + 23 + ], "_links": { "self": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/109" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/109" } ], "collection": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items" } ], "about": [ @@ -1231,22 +1327,22 @@ ], "wp:action-publish": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/109" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/109" } ], "wp:action-unfiltered-html": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/109" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/109" } ], "wp:action-create-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/109" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/109" } ], "wp:action-assign-menus": [ { - "href": "http://localhost:8889/index.php?rest_route=/__experimental/menu-items/109" + "href": "http://localhost:8889/index.php?rest_route=/wp/v2/menu-items/109" } ], "curies": [ diff --git a/packages/edit-navigation/src/components/sidebar/manage-locations.js b/packages/edit-navigation/src/components/sidebar/manage-locations.js index 6be9c290c9e8a..ee35f23c6e4a1 100644 --- a/packages/edit-navigation/src/components/sidebar/manage-locations.js +++ b/packages/edit-navigation/src/components/sidebar/manage-locations.js @@ -58,7 +58,7 @@ export default function ManageLocations( { .map( ( menuLocation ) => menuLocation.name ); return { - path: `/__experimental/menus/${ id }`, + path: `/wp/v2/menus/${ id }`, body: { locations, }, diff --git a/packages/edit-navigation/src/utils/index.js b/packages/edit-navigation/src/utils/index.js index 1fb79c32c17bc..8bd99ae1567cc 100644 --- a/packages/edit-navigation/src/utils/index.js +++ b/packages/edit-navigation/src/utils/index.js @@ -5,8 +5,8 @@ import { normalizePath } from '@wordpress/url'; /** * The purpose of this function is to create a middleware that is responsible for preloading menu-related data. - * It uses data that is returned from the /__experimental/menus endpoint for requests - * to the /__experimental/menu/ endpoint, because the data is the same. + * It uses data that is returned from the /wp/v2/menus endpoint for requests + * to the /wp/v2/menu/ endpoint, because the data is the same. * This way, we can avoid making additional REST API requests. * This middleware can be removed if/when we implement caching at the wordpress/core-data level. * @@ -43,9 +43,7 @@ export function createMenuPreloadingMiddleware( preloadedData ) { return next( options ); } - const matches = path.match( - /^\/__experimental\/menus\/(\d+)\?context=edit$/ - ); + const matches = path.match( /^\/wp\/v2\/menus\/(\d+)\?context=edit$/ ); if ( ! matches ) { return next( options ); }