diff --git a/packages/core-commands/src/site-editor-navigation-commands.js b/packages/core-commands/src/site-editor-navigation-commands.js index c1b12a84d4d61..eb7887a336a1c 100644 --- a/packages/core-commands/src/site-editor-navigation-commands.js +++ b/packages/core-commands/src/site-editor-navigation-commands.js @@ -337,7 +337,7 @@ const getSiteEditorBasicNavigationCommands = () => result.push( { name: 'core/edit-site/open-pages', - label: __( 'Pages' ), + label: __( 'Manage Pages' ), icon: page, callback: ( { close } ) => { if ( isSiteEditor ) { @@ -356,7 +356,7 @@ const getSiteEditorBasicNavigationCommands = () => result.push( { name: 'core/edit-site/open-templates', - label: __( 'Templates' ), + label: __( 'Manage Templates' ), icon: layout, callback: ( { close } ) => { if ( isSiteEditor ) { @@ -376,7 +376,7 @@ const getSiteEditorBasicNavigationCommands = () => result.push( { name: 'core/edit-site/open-patterns', - label: __( 'Patterns' ), + label: __( 'Manage Patterns' ), icon: symbol, callback: ( { close } ) => { if ( canCreateTemplate ) { diff --git a/packages/editor/src/components/commands/index.js b/packages/editor/src/components/commands/index.js index d495dcaaef337..815d05b4da6d1 100644 --- a/packages/editor/src/components/commands/index.js +++ b/packages/editor/src/components/commands/index.js @@ -9,12 +9,12 @@ import { drawerLeft, drawerRight, edit, + page, formatListBullets, listView, external, keyboard, symbol, - page, layout, rotateRight, rotateLeft, @@ -467,6 +467,50 @@ const getManipulateDocumentCommands = () => }; }; +const getDataViewCommands = () => + function useDataViewCommands() { + const commands = []; + + commands.push( { + name: 'core/data-view/all-templates', + label: __( 'Manage templates' ), + keywords: [ 'templates', 'all templates' ], + icon: layout, + callback: ( { close } ) => { + close(); + window.location.href = + '/wp-admin/site-editor.php?p=%2Ftemplate'; + }, + } ); + + commands.push( { + name: 'core/data-view/all-pages', + label: __( 'Manage pages' ), + keywords: [ 'pages', 'all pages' ], + icon: page, + callback: ( { close } ) => { + close(); + window.location.href = '/wp-admin/site-editor.php?p=%2Fpage'; + }, + } ); + + commands.push( { + name: 'core/data-view/all-pages', + label: __( 'Manage Patterns' ), + keywords: [ 'patterns', 'template parts' ], + icon: page, + callback: ( { close } ) => { + close(); + window.location.href = '/wp-admin/site-editor.php?p=%2Fpattern'; + }, + } ); + + return { + commands, + isLoading: false, + }; + }; + export default function useCommands() { useCommandLoader( { name: 'core/editor/edit-ui', @@ -489,4 +533,10 @@ export default function useCommands() { name: 'core/edit-site/manipulate-document', hook: getManipulateDocumentCommands(), } ); + + useCommandLoader( { + name: 'core/editor/data-views', + hook: getDataViewCommands(), + context: 'data-views', + } ); }