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

[Navigation] It is not possible to add custom formats/buttons to menu item toolbar #21649

Closed
manmotive opened this issue Apr 16, 2020 · 4 comments
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended

Comments

@manmotive
Copy link

manmotive commented Apr 16, 2020

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:

  • WordPress version: 5.4
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Gutenberg plugin
  • If the Gutenberg plugin is installed, which version is it? 7.9

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.

@manmotive manmotive changed the title [Navigation] Impossible to add custom formats/buttons to menu item toolbar [Navigation] It is not possible to add custom formats/buttons to menu item toolbar Apr 16, 2020
@talldan talldan added [Block] Navigation Affects the Navigation Block Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended and removed Needs Design Feedback Needs general design feedback. labels Apr 20, 2020
@jasmussen
Copy link
Contributor

Any relation to #18844?

@talldan
Copy link
Contributor

talldan commented Jan 29, 2021

Hmm, #18844 was reported before #19507 was merged, so might be different. Either way we'd need to fix this first and then test, and then should be fixing any further issues, so I think they can be combined. I closed #18844 as this one has more detail.

@talldan
Copy link
Contributor

talldan commented Jan 29, 2021

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.

@Thelmachido
Copy link

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!

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

No branches or pull requests

5 participants