From 60de8c225b0368d5bac3dbb766ca55213bbcee01 Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Wed, 8 Dec 2021 15:20:24 +1100 Subject: [PATCH] Remove Navigation Menus from WP Admin sidebar Removes the 'Navigation Menus' link from the WP Admin sidebar. Instead, a 'Manage menus' link is added to the dropdown menu in the Navigation block. --- lib/navigation.php | 2 +- .../src/navigation/edit/navigation-menu-selector.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/navigation.php b/lib/navigation.php index 26b6ced8de23ea..a6e70dd71f6aa6 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -39,7 +39,7 @@ function gutenberg_register_navigation_post_type() { 'has_archive' => false, // We should disable UI for non-FSE themes. 'show_ui' => gutenberg_is_fse_theme(), - 'show_in_menu' => 'themes.php', + 'show_in_menu' => false, 'show_in_admin_bar' => false, 'show_in_rest' => true, 'map_meta_cap' => true, diff --git a/packages/block-library/src/navigation/edit/navigation-menu-selector.js b/packages/block-library/src/navigation/edit/navigation-menu-selector.js index 05607c879913c3..66579647cb1469 100644 --- a/packages/block-library/src/navigation/edit/navigation-menu-selector.js +++ b/packages/block-library/src/navigation/edit/navigation-menu-selector.js @@ -5,6 +5,7 @@ import { MenuGroup, MenuItem, MenuItemsChoice } from '@wordpress/components'; import { useEntityId } from '@wordpress/core-data'; import { __, sprintf } from '@wordpress/i18n'; import { decodeEntities } from '@wordpress/html-entities'; +import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies @@ -45,6 +46,13 @@ export default function NavigationMenuSelector( { onSelect, onCreateNew } ) { { __( 'Create new menu' ) } + + { __( 'Manage menus' ) } + );