0

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.

  • This will almost certainly require a good amount of javascript knowledge to do, and there is no guarantee it can actually be done. – Tom J Nowell Aug 5 '19 at 16:44
0

It cannot be done, no API currently exists to add what you want to add.

If we look at the component that implements this:

https://github.com/WordPress/gutenberg/blob/5b01c97c6943890abb44b2154392ffcccef87b3e/packages/format-library/src/link/inline.js#L197

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.