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

Use a better solution for determining core nested blocks #38

Open
ingeniumed opened this issue Aug 29, 2023 · 2 comments
Open

Use a better solution for determining core nested blocks #38

ingeniumed opened this issue Aug 29, 2023 · 2 comments

Comments

@ingeniumed
Copy link
Contributor

The current approach to allowing critical core blocks is via a hardcoded map. There is a way to access the allowedBlocks property in the innerBlocks using the following command:

wp.data.select( 'core/block-editor' ).getAllowedBlocks('49abcad4-4be5-46d0-8db5-44760f15e0e7')

Using this in code causes a call stack exceeded. If this works, this would be a better solution long term.

@smithjw1
Copy link
Contributor

This issue was brought up by a VIP customer on a recent call. They are hooking into the setDefaultBlockName function from @wordpress/blocks module. Perhaps this is another method to determine what core blocks are auto-inserted.

In this client's case, they are replacing the core paragraph block with a custom block, making our hard-coded map problematic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants