Skip to content

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

@manmotive

Description

@manmotive

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] NavigationAffects the Navigation Block[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions