Skip to content

Commit

Permalink
Ensure appropriate fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Jan 11, 2023
1 parent 2d49496 commit de09077
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ function NavigationMenuSelector( {

const menuChoices = useMemo( () => {
return (
navigationMenus?.map( ( { id, title } ) => {
const label = decodeEntities( title.rendered );
navigationMenus?.map( ( { id, title }, index ) => {
const label =
decodeEntities( title.rendered ) ||
/* translators: %s is the index of the menu in the list of menus. */
sprintf( __( 'Untitled menu %s' ), index + 1 );

if ( id === currentMenuId && ! isCreatingMenu ) {
setSelectorLabel(
/* translators: %s is the name of a navigation menu. */
Expand Down

0 comments on commit de09077

Please sign in to comment.