I’m working on a theme that should style all native WordPress blocks via CSS, including potentially extending them with custom ‘style’ options in the block editor via JS. Does anyone know of a list or reference site which lists all native blocks, ideally including information on the WordPress version(s) where they were introduced and links to their registerBlockStyle ‘names’ (ie, core/button or core/buttons)? Searching in the Codex, Handbook and in Google isn’t getting me anywhere so far.

Obviously I can go in and add every block to a Page and style it but it’s hard to keep track of what’s needed. An updated version of the Block Unit Test plugin might help too, but it looks like that’s not being updated.

If I have to roll my own so be it (and I’ll happily share) but I figured why reinvent the wheel… 🙂 Thanks!

2 s
2

Not at the moment, but, you can go to a page with the block editor, open the browser dev tools, go to the console, and run the following:

// 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 );

Leave a Reply

Your email address will not be published. Required fields are marked *