最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

block editor - Clipboard processing in Gutenburg

matteradmin8PV0评论

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?

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far