admin管理员组文章数量:1402847
I'm trying to block a custom javascript function from running (with an appropriate error, of course) if the current post is dirty (ie, something has changed either in the editor or a custom field). I can't seem to find the variable or function that the editor page uses to determine this.
Edit for further information: I've added an ACF block in the sidebar, on the Edit page of a custom post type, that has several buttons that have onclick events to run a JS function. That much is working properly as it is.
The CPT has a bunch of ACF select and text fields, as well as a WYSIWYG editor (the old-style TinyMCE editor).
At the beginning of this function, I want it to check to see if the post is dirty - content added or edited in the TinyMCE editor, any of the select or text fields updated - so that I can throw a warning to the user that the post must be published or updated before clicking the button to run my function.
There isn't any code snippits that I can provide in this instance... because I don't know what I'm looking for to see if the post is dirty.
本文标签: block editorHow can I check if a post is dirty using javascript on the edit post screen
版权声明:本文标题:block editor - How can I check if a post is dirty using javascript on the edit post screen? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744342166a2601540.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论