Skip to content

Navigation block: Added a hook to add allowFormat #67559

@shimotmk

Description

@shimotmk

What problem does this address?

Hello👋

I would like a hook for the navigation block allowedFormats.

Adding a hook here makes it easier to customize from plugins.

For example, adding inline icon markup.

In the classic theme, you could add HTML tags to the menu label.

(Although this may not have been very good security practice.)

<span class="dashicons dashicons-admin-home"></span>WordPress

This is how it looks in Twenty Twenty-One

Image

Image

Twenty Twenty-Five example

In block themes, you can only add formats allowed by allowedFormats.

Image

Adding a hook to allowedFormats will allow customization from plugins, allowing for a variety of design expressions.

Thank you for your consideration.

What is your proposed solution?

Add a hook to add allowedFormats.

allowedFormats={ [
'core/bold',
'core/italic',
'core/image',
'core/strikethrough',
] }

allowedFormats={ [
'core/bold',
'core/italic',
'core/image',
'core/strikethrough',
] }

label

[Block] Navigation

[Block] Navigation Link

Metadata

Metadata

Assignees

Labels

[Block] Navigation LinkAffects the Navigation Link Block[Block] SubmenuAffects the Submenu Block - for submenus in navigation[Status] In ProgressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions