Skip to content

Commit

Permalink
Add Navigation Menus to known root entities (WordPress#39498)
Browse files Browse the repository at this point in the history
* Add Navigation menu to known entities

* Add comments for clarity

Addresses WordPress#39498 (comment)
  • Loading branch information
getdave authored and jostnes committed Mar 23, 2022
1 parent 2d30a6f commit d376b51
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/core-data/src/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ export const rootEntitiesConfig = [
label: __( 'Comment' ),
},
{
name: 'menu',
name: 'menu', // Classic Menus
kind: 'root',
baseURL: '/wp/v2/menus',
baseURLParams: { context: 'edit' },
plural: 'menus',
label: __( 'Menu' ),
},
{
name: 'menuItem',
name: 'menuItem', // Classic Menu Items
kind: 'root',
baseURL: '/wp/v2/menu-items',
baseURLParams: { context: 'edit' },
Expand All @@ -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' },
Expand All @@ -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' },
Expand Down Expand Up @@ -175,6 +175,14 @@ export const rootEntitiesConfig = [
baseURLParams: { context: 'edit' },
key: 'plugin',
},
{
label: __( 'Navigation' ), // Block based Navigation Menus
name: 'navigationMenu',
kind: 'root',
baseURL: '/wp/v2/navigation',
baseURLParams: { context: 'edit' },
plural: 'navigationMenus',
},
];

export const additionalEntityConfigLoaders = [
Expand Down

0 comments on commit d376b51

Please sign in to comment.