diff --git a/packages/block-library/src/navigation/edit/index.js b/packages/block-library/src/navigation/edit/index.js index 0ae0a770f20627..3069bee213114c 100644 --- a/packages/block-library/src/navigation/edit/index.js +++ b/packages/block-library/src/navigation/edit/index.js @@ -187,9 +187,9 @@ function Navigation( { hasResolvedCanUserUpdateNavigationMenu, canUserDeleteNavigationMenu, hasResolvedCanUserDeleteNavigationMenu, - canUserCreateNavigationMenu, - isResolvingCanUserCreateNavigationMenu, - hasResolvedCanUserCreateNavigationMenu, + canUserCreateNavigationMenus, + isResolvingCanUserCreateNavigationMenus, + hasResolvedCanUserCreateNavigationMenus, } = useNavigationMenu( ref ); const navMenuResolvedButMissing = @@ -467,8 +467,8 @@ function Navigation( { if ( ! ref && - hasResolvedCanUserCreateNavigationMenu && - ! canUserCreateNavigationMenu + hasResolvedCanUserCreateNavigationMenus && + ! canUserCreateNavigationMenus ) { showNavigationMenuPermissionsNotice( __( @@ -482,8 +482,8 @@ function Navigation( { isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, - canUserCreateNavigationMenu, - hasResolvedCanUserCreateNavigationMenu, + canUserCreateNavigationMenus, + hasResolvedCanUserCreateNavigationMenus, ref, hideNavigationMenuPermissionsNotice, showNavigationMenuPermissionsNotice, @@ -491,7 +491,7 @@ function Navigation( { ] ); const hasManagePermissions = - canUserCreateNavigationMenu || canUserUpdateNavigationMenu; + canUserCreateNavigationMenus || canUserUpdateNavigationMenu; const overlayMenuPreviewClasses = classnames( 'wp-block-navigation__overlay-menu-preview', @@ -801,9 +801,11 @@ function Navigation( { isSelected={ isSelected } currentMenuId={ ref } clientId={ clientId } - canUserCreateNavigationMenu={ canUserCreateNavigationMenu } - isResolvingCanUserCreateNavigationMenu={ - isResolvingCanUserCreateNavigationMenu + canUserCreateNavigationMenus={ + canUserCreateNavigationMenus + } + isResolvingCanUserCreateNavigationMenus={ + isResolvingCanUserCreateNavigationMenus } onSelectNavigationMenu={ onSelectNavigationMenu } onSelectClassicMenu={ onSelectClassicMenu } 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 ab9d5ec399deb8..e232cb089a00bf 100644 --- a/packages/block-library/src/navigation/edit/navigation-menu-selector.js +++ b/packages/block-library/src/navigation/edit/navigation-menu-selector.js @@ -59,7 +59,7 @@ function NavigationMenuSelector( { navigationMenus, isResolvingNavigationMenus, hasResolvedNavigationMenus, - canUserCreateNavigationMenu, + canUserCreateNavigationMenus, canSwitchNavigationMenu, } = useNavigationMenu(); @@ -100,7 +100,7 @@ function NavigationMenuSelector( { const hasNavigationMenus = !! navigationMenus?.length; const hasClassicMenus = !! classicMenus?.length; const showNavigationMenus = !! canSwitchNavigationMenu; - const showClassicMenus = !! canUserCreateNavigationMenu; + const showClassicMenus = !! canUserCreateNavigationMenus; const noMenuSelected = hasNavigationMenus && ! currentMenuId; const noBlockMenus = ! hasNavigationMenus && hasResolvedNavigationMenus; @@ -129,7 +129,7 @@ function NavigationMenuSelector( { }, [ hasResolvedNavigationMenus, createNavigationMenuIsSuccess, - canUserCreateNavigationMenu, + canUserCreateNavigationMenus, createNavigationMenuIsError, isUpdatingMenuRef, menuUnavailable, @@ -187,7 +187,7 @@ function NavigationMenuSelector( { ) } - { canUserCreateNavigationMenu && ( + { canUserCreateNavigationMenus && ( { diff --git a/packages/block-library/src/navigation/edit/placeholder/index.js b/packages/block-library/src/navigation/edit/placeholder/index.js index 61fd13c8d97798..0d7c1a7c863b54 100644 --- a/packages/block-library/src/navigation/edit/placeholder/index.js +++ b/packages/block-library/src/navigation/edit/placeholder/index.js @@ -18,8 +18,8 @@ export default function NavigationPlaceholder( { isSelected, currentMenuId, clientId, - canUserCreateNavigationMenu = false, - isResolvingCanUserCreateNavigationMenu, + canUserCreateNavigationMenus = false, + isResolvingCanUserCreateNavigationMenus, onSelectNavigationMenu, onSelectClassicMenu, onCreateEmpty, @@ -41,7 +41,7 @@ export default function NavigationPlaceholder( { }, [ hasResolvedMenus, isResolvingMenus, isSelected ] ); const isResolvingActions = - isResolvingMenus && isResolvingCanUserCreateNavigationMenu; + isResolvingMenus && isResolvingCanUserCreateNavigationMenus; return ( <> @@ -74,7 +74,7 @@ export default function NavigationPlaceholder( {
- { canUserCreateNavigationMenu && ( + { canUserCreateNavigationMenus && (