Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Classic Menu using the menu name as the block menu title #48771

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

getdave
Copy link
Contributor

@getdave getdave commented Mar 6, 2023

What?

Fixes Classic Menu import in the Nav block to use the menu's name rather than it's slug for the Navigation menu's title.

Spun out of #48625 just in case that one doesn't land.

Why?

Using the slug for a title is sub optimal. We should prefer the menu's name as it maps better to the post title.

How?

Using the classic menu name attribute rather than slug when create the Navigation menu post (wp_navigation).

Testing Instructions

  • Delete all Navigation Menus at http://localhost:8888/wp-admin/edit.php?post_type=wp_navigation
  • Switch to Classic Theme.
  • Create Menu with a name you can remember.
  • Switch to Block Theme (do not visit editor!)
  • Go to front of site (this should import the Classic Menu).
  • Go to http://localhost:8888/wp-admin/edit.php?post_type=wp_navigation.
  • Check the title of the imported Navigation menu matches with that of the Classic Menu

Testing Instructions for Keyboard

Screenshots or screencast

@getdave getdave self-assigned this Mar 6, 2023
@getdave getdave added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Mar 6, 2023
@getdave getdave marked this pull request as ready for review March 6, 2023 10:05
@getdave getdave requested a review from tellthemachines as a code owner March 6, 2023 10:05
@github-actions
Copy link

github-actions bot commented Mar 6, 2023

Flaky tests detected in dc9cfea.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4342151358
📝 Reported issues:

Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@getdave getdave merged commit 7b7a5e6 into trunk Mar 6, 2023
@getdave getdave deleted the fix/nav-block-classic-menu-import-use-menu-name branch March 6, 2023 11:52
@github-actions github-actions bot added this to the Gutenberg 15.4 milestone Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants