How to extend the URLPopover render settings for the paragraph Gutenberg block?

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

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.

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.

Share Improve this question edited Aug 6, 2019 at 17:19 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Aug 5, 2019 at 16:23 MarkMark 1,0291 gold badge15 silver badges27 bronze badges 1
  • 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 Commented Aug 5, 2019 at 16:44
Add a comment  | 

1 Answer 1

Reset to default 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/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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745264438a4619367.html

相关推荐

  • How to extend the URLPopover render settings for the paragraph Gutenberg block?

    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

    4小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信