Skip to content

Commit

Permalink
Remove generated slug and allow WP Core to create unique slug
Browse files Browse the repository at this point in the history
Simplifies this PR
  • Loading branch information
getdave committed Nov 2, 2022
1 parent 949beaa commit 2752acf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
6 changes: 2 additions & 4 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import useConvertClassicToBlockMenu, {
} from './use-convert-classic-menu-to-block-menu';
import useCreateNavigationMenu from './use-create-navigation-menu';
import { useInnerBlocks } from './use-inner-blocks';
import useGeneratedSlug from './use-generated-slug';

import { detectColors } from './utils';
import { DEFAULT_ENTITY_KIND, DEFAULT_ENTITY_TYPE } from '../constants';

Expand Down Expand Up @@ -113,8 +113,6 @@ function Navigation( {
const hasAlreadyRendered = useHasRecursion( recursionId );
const { editEntityRecord } = useDispatch( coreStore );

const generatedSlug = useGeneratedSlug( clientId );

// Preload classic menus, so that they don't suddenly pop-in when viewing
// the Select Menu dropdown.
const { menus: classicMenus } = useNavigationEntities();
Expand Down Expand Up @@ -152,7 +150,7 @@ function Navigation( {
} = useCreateNavigationMenu( clientId );

const createUntitledEmptyNavigationMenu = () =>
void createNavigationMenu( '', [], null, generatedSlug );
void createNavigationMenu( '', [], null );

useEffect( () => {
hideNavigationMenuStatusNotice();
Expand Down
37 changes: 0 additions & 37 deletions packages/block-library/src/navigation/edit/use-generated-slug.js

This file was deleted.

0 comments on commit 2752acf

Please sign in to comment.