Gutenberg disallow certain custom blocks but keep all core blocks?


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?

Aravona 8 months 2020-11-30T08:10:34-05:00 0 Answers 9 views 0

Leave an answer