Search code examples
wordpresstinymcewysiwyg

Using wp_editor tinyMCE in metabox cause form alert on leaving page


Using tinyMCE as wp_editor in a custom post type metabox create an alert when I try to submit or If I want to change location

enter image description here

I don't have such behavior using Quicktags, but since TinyMCE is easier to use I'd like to use it.


Solution

  • It seems to be wordpress 5.6 issue,

    I fixed it by disabling autosave()

    add_action( 'admin_init', 'disable_autosave' );
    function disable_autosave() {
        wp_deregister_script( 'autosave' );
    }
    

    Or you can downgrade your version of wordpress.

    You can also check the issue oncore.trac.wordpress.org See this answer : https://wordpress.stackexchange.com/questions/383609/post-category-behave-like-a-post-in-back-office-menu