Gutenberg: Get list of registered blocks

Created on 10 Dec 2018  路  2Comments  路  Source: WordPress/gutenberg

I have the same question as #12219 but I'm interested in how to list all registered blocks in Chrome's Console (JavaScript)?

The documentation list is not up-to-date here: https://codex.wordpress.org/Gutenberg

[Feature] Block API [Type] Help Request

Most helpful comment

It'd be easier to keep similar questions in one place, but have you tried the getBlockTypes function from the @wordpress/blocks package?

It uses the data package internally, so this would be equal to running wp.data.select( 'core/blocks' ).getBlockTypes() in the Chrome dev tools. This gives you a list of all registered block types, from both core and plugins.

Please note that for up-to-date Gutenberg documentation I would advise against using the Codex. Try the Gutenberg Handbook instead: https://wordpress.org/gutenberg/handbook/

All 2 comments

It'd be easier to keep similar questions in one place, but have you tried the getBlockTypes function from the @wordpress/blocks package?

It uses the data package internally, so this would be equal to running wp.data.select( 'core/blocks' ).getBlockTypes() in the Chrome dev tools. This gives you a list of all registered block types, from both core and plugins.

Please note that for up-to-date Gutenberg documentation I would advise against using the Codex. Try the Gutenberg Handbook instead: https://wordpress.org/gutenberg/handbook/

Awesome. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidsword picture davidsword  路  3Comments

BE-Webdesign picture BE-Webdesign  路  3Comments

jasmussen picture jasmussen  路  3Comments

maddisondesigns picture maddisondesigns  路  3Comments

mhenrylucero picture mhenrylucero  路  3Comments