customization - Gutenberg extend core blocks

admin2025-06-04  1

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?

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?

Share Improve this question asked Jan 5, 2019 at 18:09 fefefefe 8943 gold badges14 silver badges34 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 5

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

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749039083a315840.html

最新回复(0)