Gutenberg extend core blocks

How do I modify a core block, in my case gallery block to add extra markup to can fire some lightbox on created gallery. Is there a way to hook in on render of gallery on frontpage to adjust markup?

1
1

You need to use Block Filters to modify existing blocks. There are couple of handy hooks you need to use in place of edit and save function to wrap around core blocks into your desirable block structure.

For your purpose I guess, you need to use – blocks.getSaveElement and editor.BlockEdit

Leave a Comment