Open swissspidy opened 5 years ago
Are there more issues like that? If we were to offer this kind of functionality, we should come up with a general-purpose solution that would allow us to filter out all menu items and groups.
I have been trying to figure out a solution for this same issue and was using the CSS approach to hide the block manager. Additionally though, I need to hide it based on user role for my project, so I think a general-purpose solution like you mentioned would be really great if menu items and groups could be hidden based on user role or post type.
now in the https://github.com/WordPress/gutenberg/blob/trunk/packages/edit-post/src/components/block-manager/index.js block-manager component
Is your feature request related to a problem? Please describe.
In our project we have some blocks that are absolutely crucial to editing a specific custom post type.
The BlockManager allows disabling all blocks, including the crucial ones. Doing so would lead to unexpected behavior.
Describe the solution you'd like
There should be a way to prevent individual block types from being disabled in the block manager.
In addition to that, or as an alternative, there could be a way to completely disable the block manager.
If you have a custom post type with only two registered custom block types that are crucial to editing the post, it makes no sense to offer the block manager at all.
Describe alternatives you've considered
Hiding the block manager or individual blocks in the block manager via CSS is the only possible alternative I see at the moment. Which is not a good alternative IMO.