From 1ac66de220c3a668d1d81abae19abdbd8543bda4 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 16 Mar 2022 12:02:03 +0000 Subject: [PATCH 1/2] Add Navigation menu to known entities --- packages/core-data/src/entities.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core-data/src/entities.js b/packages/core-data/src/entities.js index 09731d54841fc..f62c0313f380d 100644 --- a/packages/core-data/src/entities.js +++ b/packages/core-data/src/entities.js @@ -175,6 +175,14 @@ export const rootEntitiesConfig = [ baseURLParams: { context: 'edit' }, key: 'plugin', }, + { + label: __( 'Navigation' ), + name: 'navigationMenu', + kind: 'root', + baseURL: '/wp/v2/navigation', + baseURLParams: { context: 'edit' }, + plural: 'navigationMenus', + }, ]; export const additionalEntityConfigLoaders = [ From be9d317feeca1f21f88482a1c12a734c40b3e9e2 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 16 Mar 2022 13:48:04 +0000 Subject: [PATCH 2/2] Add comments for clarity Addresses https://github.com/WordPress/gutenberg/pull/39498#issuecomment-1069104704 --- packages/core-data/src/entities.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core-data/src/entities.js b/packages/core-data/src/entities.js index f62c0313f380d..aa0abe56515ea 100644 --- a/packages/core-data/src/entities.js +++ b/packages/core-data/src/entities.js @@ -115,7 +115,7 @@ export const rootEntitiesConfig = [ label: __( 'Comment' ), }, { - name: 'menu', + name: 'menu', // Classic Menus kind: 'root', baseURL: '/wp/v2/menus', baseURLParams: { context: 'edit' }, @@ -123,7 +123,7 @@ export const rootEntitiesConfig = [ label: __( 'Menu' ), }, { - name: 'menuItem', + name: 'menuItem', // Classic Menu Items kind: 'root', baseURL: '/wp/v2/menu-items', baseURLParams: { context: 'edit' }, @@ -132,7 +132,7 @@ export const rootEntitiesConfig = [ rawAttributes: [ 'title', 'content' ], }, { - name: 'menuLocation', + name: 'menuLocation', // Classic Menu Locations kind: 'root', baseURL: '/wp/v2/menu-locations', baseURLParams: { context: 'edit' }, @@ -141,7 +141,7 @@ export const rootEntitiesConfig = [ key: 'name', }, { - name: 'navigationArea', + name: 'navigationArea', // Deprecated - can be removed once the concepts of Navigation Areas is removed from the codebase. kind: 'root', baseURL: '/wp/v2/block-navigation-areas', baseURLParams: { context: 'edit' }, @@ -176,7 +176,7 @@ export const rootEntitiesConfig = [ key: 'plugin', }, { - label: __( 'Navigation' ), + label: __( 'Navigation' ), // Block based Navigation Menus name: 'navigationMenu', kind: 'root', baseURL: '/wp/v2/navigation',