Navigation: Support customizable overlay toggle button label for menu differentiation - #82008
Conversation
9896ad3 to
81ec690
Compare
81ec690 to
0d35ad8
Compare
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @kazerniel. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Closes #81935
Adds an optional
overlayButtonLabelattribute and a settings field to the Navigation block so editors can customize the text and accessible label of the mobile overlay toggle button.Why?
When a page contains more than one Navigation block that collapses on mobile (such as a header menu and a footer/utility menu), all overlay buttons display the default text "Menu" and announce
aria-label="Open menu".Visitors and screen-reader users have no way to tell which button opens which menu. Allowing a custom label lets editors distinguish between multiple menus (e.g., "Primary Menu" vs. "Footer Menu").
How?
overlayButtonLabel(string) toblock.json. It defaults to an empty string and falls back to"Menu"for 100% backward compatibility.overlay-menu-preview-controls.js) when "Show icon button" is disabled.overlay-menu-preview-button.jsandresponsive-wrapper.jsto reflect the custom label in the inspector preview, the canvas toggle button, and the modal dialog landmark.index.phpso the server renders the custom label for text buttons, generatesaria-label="Open <Label>"for icon buttons, and binds the custom label.Testing Instructions
Screenshots or screencast
Screen.Recording.2026-08-24.at.14.02.54.mov
Use of AI Tools
Used Gemini Flash 3.5 for drafting and review