-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Navigation] It is not possible to add custom formats/buttons to menu item toolbar #21649
Comments
Any relation to #18844? |
Thinking about a potential solution, I wonder if we can fetch the list of formats and them omit the core ones we don't want in the nav link block, instead of hard-coding it completely. |
Closing this issue due to the Navigation editor project being moved to an inactive status on the feature projects page in coordination with the project leads. The developer documentation in the initial post are no longer accessible If this work is picked back up, issues can be revisited and reopened as needed. Thanks for testing this early feature and giving feedback so the wider WordPress project could benefit from the lessons learned! |
Describe the bug
I am attempting to follow this guide to add a button to the menu item toolbar:
https://developer.wordpress.org/block-editor/tutorials/format-api/1-register-format/
This is not possible as the toolbar for menu items has a defined set of "AllowedFormats":
9401b9f
This makes it impossible to extend the menu item toolbar with new formats / buttons.
To reproduce
Follow this guide:
https://developer.wordpress.org/block-editor/tutorials/format-api/1-register-format/
(in step 1, you need to use "admin_enqueue_scripts" rather than "enqueue_block_editor_assets" - already reported in #21648)
Notice the format / button is correctly added to the Page/Post editor, but not the menu item toolbar.
Expected behavior
A new format / button would be added to the menu item toolbar.
Editor version:
Can the logic be changed to specify a list of 'DisallowedFormats' rather than 'AllowedFormats'? This could remove the unnecessary core formats as required, whist allowing plugins to register new ones.
The text was updated successfully, but these errors were encountered: