最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

block editor - Clipboard processing in Gutenburg

programmeradmin6浏览0评论

When WordPress was just using TinyMCE for its editor, it seems that there was a pretty straightforward manner of inserting custom code into the processing that would occur after the user requested to paste something into the editor.

It's a brave new world, and the Gutenburg editor is the new (and future) standard for WordPress content editing.

My question is: Is there currently (April 2019) a way for me to filter text that is pasted into the Gutenburg block editor as it is being pasted (as opposed to during the saving process, for example, with the content_save_pre hook)?

In an attempt to answer this question, I spent a lot of time sifting through the Gutenburg editor code yesterday, particularly the part that processes pasting.

It (unsurprisingly) is very involved, but from what I could find, it does not seem that there is any equivalent to the paste_preprocess hook that there was (and is) in TinyMCE.

I am not willing to edit my copy of core WordPress to get the behavior I want out of Gutenburg; obviously plugins are the alternative designed for customizing WordPress' behavior, so I would like to go that route; I'm just not sure there is actually a plugin route available here.

Do I need to go straight to the top with a feature request? Or am I missing something?

发布评论

评论列表(0)

  1. 暂无评论