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 block: Added a hook to add allowFormat #67559

Closed
shimotmk opened this issue Dec 4, 2024 · 2 comments · Fixed by #67585
Closed

Navigation block: Added a hook to add allowFormat #67559

shimotmk opened this issue Dec 4, 2024 · 2 comments · Fixed by #67585
Assignees
Labels
[Block] Navigation Link Affects the Navigation Link Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@shimotmk
Copy link
Contributor

shimotmk commented Dec 4, 2024

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

@shimotmk shimotmk added the [Type] Enhancement A suggestion for improvement. label Dec 4, 2024
@Mamaduka Mamaduka added [Block] Navigation Link Affects the Navigation Link Block [Block] Submenu Affects the Submenu Block - for submenus in navigation labels Dec 4, 2024
@Mamaduka Mamaduka self-assigned this Dec 4, 2024
@Mamaduka
Copy link
Member

Mamaduka commented Dec 4, 2024

I think I've got a solution that doesn't require a filter. I'll push a PR later today.

@Mamaduka
Copy link
Member

Mamaduka commented Dec 4, 2024

Here's the PR - #67585.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Link Affects the Navigation Link Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants