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

Missing blocks: add filter allowing customizing the "missing" message #68532

Open
jeherve opened this issue Jan 7, 2025 · 1 comment
Open
Labels
[Type] Enhancement A suggestion for improvement.

Comments

@jeherve
Copy link
Contributor

jeherve commented Jan 7, 2025

What problem does this address?

Some themes bundle patterns including blocks that are provided via plugins, or a site owner may have used a block from a plugin, and then disabled the block in the plugin's options or lost access to the feature. At that point, the site editor can only display a generic error message.

This is nice, but in the cases where the plugin providing the block is still active on the site, it would be nice if there was a way for plugin authors to filter the message to offer a workaround to site owners.

What is your proposed solution?

When the messages were first introduced in #22631, we had a editor.missingEdit filter we could use. Unfortunately, that filter was then removed in #25264, and I don't believe the messages can be filtered anymore.

Would it be possible to add such a filter back?

@jeherve jeherve added the [Type] Enhancement A suggestion for improvement. label Jan 7, 2025
@Mamaduka
Copy link
Member

Mamaduka commented Jan 8, 2025

It's possible to override the core/missing block's edit component using the editor.BlockEdit filter or using the same method as Block Directory.

I know it's a bit more code, but general solutions should be preferred over "one-off" filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants