By Sean


2019-02-06 18:32:48 8 Comments

I want to run some JavaScript when a user uploads an image or images using the core/image block or core/gallery block. Ideally I would run my own code when the onSelectImage function is called (and the equivalent for core/gallery). I've looked at hooks in Gutenberg but it seems that they're only available in a small number of places, and there are none directly for the core/image or core/gallery blocks.

I know the developers intend to make it easy to apply actions and filters in Gutenberg, but I'm not sure if they just haven't added any hooks/filters for the core/image block yet or if it's already possible but I'm not seeing how to do it.

0 comments

Related Questions

Sponsored Content

1 Answered Questions

gutenberg dynamic block is returning 404

2 Answered Questions

Gutenberg blocks not getting styled on back end

0 Answered Questions

Draggable item in custom gutenberg block

0 Answered Questions

Overriding HTML/CSS Classes of "Columns" block from Gutenberg editor

0 Answered Questions

create-guten-block in wordpress theme?

0 Answered Questions

Modify the core/paragraph block

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

0 Answered Questions

2 Answered Questions

Gutenberg custom block plugin with custom image sizes

2 Answered Questions

[SOLVED] For developers, what impact can we expect Gutenberg to have on the loop?

  • 2018-10-29 02:38:25
  • GoingMush
  • 57 View
  • 0 Score
  • 2 Answer
  • Tags:   block-editor

0 Answered Questions

How to use styled-components within a custom Gutenberg block?

Sponsored Content