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] If I dequeue Gutenberg Stylesheet will that have any effect on WordPress 5.0.1?

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
  • 54 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
  • 611 View
  • 2 Score
  • 1 Answer
  • Tags:   block-editor

1 Answered Questions

[SOLVED] Block validation: Block validation failed for `my-block`

  • 2018-09-20 08:58:50
  • André Kelling
  • 1015 View
  • 1 Score
  • 1 Answer
  • Tags:   block-editor

1 Answered Questions

[SOLVED] Validation error: Extending Gutenberg gallery block

1 Answered Questions

[SOLVED] Extend core block in Gutenberg

0 Answered Questions

Gutenberg Editor - Template Doesn't Match Error

1 Answered Questions

[SOLVED] Gutenberg extend blocks add new class name

Sponsored Content