在 metabox 中使用 wp_editor tinyMCE 导致在离开页面时出现表单警报

Using wp_editor tinyMCE in metabox cause form alert on leaving page

在自定义 post 类型的 metabox 中将 tinyMCE 用作 wp_editor 当我尝试提交或如果我想更改位置时创建警报

我在使用 Quicktags 时没有这种行为,但由于 TinyMCE 更易于使用,我想使用它。

好像是wordpress 5.6的问题,

我通过禁用自动保存()

修复了它
add_action( 'admin_init', 'disable_autosave' );
function disable_autosave() {
    wp_deregister_script( 'autosave' );
}

或者你可以降级你的wordpress版本。

你也可以查看issue oncore.trac.wordpress.org 看到这个答案:https://wordpress.stackexchange.com/questions/383609/post-category-behave-like-a-post-in-back-office-menu