Gutenberg disallow certain custom blocks but keep all core blocks?

Question

I’m writing a function to allow only some custom blocks – essentially I want to register all the blocks, then based on a database table of ‘selected’ blocks disallow any other custom block.

I can use allowed_block_types to make an array of allowed blocks, but it wipes all the core ones, is there a way to either get a reliable list of core blocks, or only add a filter for plugin/theme registered blocks? Or possibly, allow all block
categories then my own block category is filtered?

0
Aravona 2 months 0 Answers 9 views 0

Leave an answer