Set default image link target in Gutenberg image block

Question

I want to set the default target of the image block in Gutenberg to “Media File”:

Link target

I’ve found solutions for the classic editor, and one that appears to work for Gutenberg galleries by editing the block’s template, but I was under the impression that the intended way to modify the editor’s behaviour is via JavaScript hooks in the block editor.

Is there a way to set the default target using a JavaScript hook in the block editor?

UPDATE: I made a pull request on the Gutenberg GitHub repository to try to implement the ability to override the default link target with a plugin. The latest version is here. As of writing, this has not yet been merged.

0
, , , , Sean 4 years 2019-02-01T14:39:57-05:00 0 Answers 99 views 0

Leave an answer

Browse
Browse