-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Transform block allows transforming into blacklisted/non-whitelisted blocks #9047
Comments
Adding related documentation links for reference:
I found this in a past discussion—it was in a conversation about
Source: #6753 (comment) In addition to whitelisting the image block, could you try blacklisting the gallery block to see if that solves the problem in this case? |
I have done all the whitelisting from php, but when I try to add |
How are you exactly "whitelisting" the blocks? |
I'm using this filter
The whitelist looks something like this
|
According to the documentation |
Just tried to unregister all the core blocks but whitelisting the list block: inserted it and trying to transform it, the editor gives an error like "The editor has encountered an unexpected error", and i have this in the console |
I believe this happens because you can't unregister all core blocks, some are mandatory: freeform, paragraph, html probably. |
Ok, you're right: i've repeated the test, unregistering only the subhead block, and it won't show up in the transformations inserter. |
You can just use a javascript script to unregister the block types you want. And load a separate script per post type to unregister different blocks for different post types. Closing the issue for now, let me know if you need more help. |
We have a whitelist of default blocks that that are allowed in the editor. For instance we have whitelisted the
core/image
block, but the gallery block is not in this list. However, we are still able to insert a image block, and transform it into a gallery. Once we reload the page in the editor, the block will error out, because the gallery block is not available.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect blocks that can be transformed to not show an option of transforming into a blacklisted/non-available block.
The text was updated successfully, but these errors were encountered: