Skip to content

Commit

Permalink
Remove Navigation Menus from WP Admin sidebar (#37212)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
noisysocks committed Dec 13, 2021
1 parent 027a3db commit 8a278c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -45,6 +46,13 @@ export default function NavigationMenuSelector( { onSelect, onCreateNew } ) {
<MenuItem onClick={ onCreateNew }>
{ __( 'Create new menu' ) }
</MenuItem>
<MenuItem
href={ addQueryArgs( 'edit.php', {
post_type: 'wp_navigation',
} ) }
>
{ __( 'Manage menus' ) }
</MenuItem>
</MenuGroup>
</>
);
Expand Down

0 comments on commit 8a278c0

Please sign in to comment.