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

Fix duplicate custom classnames in navigation submenu block #36478

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Nov 15, 2021

Description

Fixes #36464

This is a pretty straightforward fix. The get_block_wrapper_attributes already calls the custom class name hook to add the classnames to the rendered block markup. It seems the nav submenu block also had some custom code that did the same, likely this was copied from the navigation link block, as the same issue was fixed there in #35634.

That custom code isn't needed so can be removed.

How has this been tested?

  1. In the Editor, add a submenu block
  2. Add a class for the submenu block in Advanced > Additional CSS class(es)
  3. Save your page
  4. Go to the live page and inspect the submenu block
  5. The classname should only be output once

Screenshots

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@talldan talldan added [Type] Bug An existing feature does not function as intended Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta [Block] Submenu Affects the Submenu Block - for submenus in navigation labels Nov 15, 2021
@talldan talldan self-assigned this Nov 15, 2021
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thanks, @talldan.

Changes look good and work as expected.

@talldan talldan force-pushed the fix/nav-submenu-duplicate-classnames branch from dcd709d to 315d42d Compare November 16, 2021 01:36
@talldan talldan merged commit 7426740 into trunk Nov 16, 2021
@talldan talldan deleted the fix/nav-submenu-duplicate-classnames branch November 16, 2021 02:21
@github-actions github-actions bot added this to the Gutenberg 12.0 milestone Nov 16, 2021
@noisysocks noisysocks removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation Block: Submenu additional class duplication
3 participants