Last active
September 7, 2022 12:49
-
-
Save vburlak/9928afdb11d4584a3a620ecbeb67fa0d to your computer and use it in GitHub Desktop.
Log all default Gutenberg Blocks in Console Log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// grab all block types | |
const types = wp.blocks.getBlockTypes(); | |
// filter to just the core blocks | |
const core_blocks = types.filter( | |
type => type.name.startsWith( 'core/' ) | |
); | |
// grab just the names | |
const block_names = core_blocks.map( type => type.name ); | |
// display in the console | |
console.log( block_names ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this while Gutenberg Editor screen is open