Add this moment when you enter an URL in a Paragraph-block there is only one setting: Open in New Tab. I like to be able to add settings such as Link Style. That adds a class to a link.
1 Answer
It cannot be done, no API currently exists to add what you want to add.
If we look at the component that implements this:
The InlineLinkUI
wraps a component that wraps the URLPopover
component, and places a child component inside it which is how the new window checkbox is added. No slots are present or hooks for intercepting this.
Judging from what you want to do, I don't think this is the intended path forward. Instead, build a block, or a new inline block. You can also open an issue on the Gutenberg GitHub requesting the feature
-
Thanks for your answer. Could you elaborate more on what you mean with a new Inline Block? Do you mean a block with a display:inline-block style?– MarkCommented Aug 5, 2019 at 17:11
-
No, there's a type of block that appears inline in a paragraph block, but it's not mentioned often, here's the PR that first introduced the feature github.com/WordPress/gutenberg/pull/6959– Tom J Nowell ♦Commented Aug 5, 2019 at 22:53
-
1More about Format API: developer.wordpress.org/block-editor/tutorials/format-api Commented Sep 20, 2019 at 10:43