By fefe


2019-01-05 18:09:16 8 Comments

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 comments

@Ashiquzzaman Kiron 2019-01-06 04:50:33

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

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] Add a containing DIV to core Gutenberg blocks

0 Answered Questions

Gutenberg Block Editor - Copy Core Columns Block - Webpack

2 Answered Questions

0 Answered Questions

Modify the core/paragraph block

  • 2019-01-06 15:05:36
  • Michael
  • 133 View
  • 2 Score
  • 0 Answer
  • Tags:   block-editor

0 Answered Questions

Changing image size to full size in Gutenberg's block gallery

1 Answered Questions

[SOLVED] Gutenberg moving core blocks between categories

  • 2018-12-07 10:28:05
  • SamXronn
  • 111 View
  • 2 Score
  • 1 Answer
  • Tags:   block-editor

1 Answered Questions

[SOLVED] Gutenberg - how to correctly perform ajax request on backend

1 Answered Questions

[SOLVED] How can I add a custom attribute to Gutenberg core blocks?

  • 2018-09-26 03:51:08
  • Eric Murphy
  • 1193 View
  • 2 Score
  • 1 Answer
  • Tags:   block-editor

1 Answered Questions

[SOLVED] Extend core block in Gutenberg

0 Answered Questions

Gutenberg Editor - Template Doesn't Match Error

Sponsored Content