Trigger Autosave or disable unsaved changes dialog

As the title says, I want to trigger the autosave function of wordpress manually or just disable the “unsaved changes” dialog.

The reason for this: I’m developing a plugin which reloads the post edit page after doing some stuff and it’s just annoying that the “unsaved changes” popup always pops up before reloading.

1 Answer
1

You could disable it with: source

function disableAutoSave(){
    wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disableAutoSave' );

Also not a real answer, edit the interval in the WP-config:
http://codex.wordpress.org/Editing_wp-config.php#Modify_AutoSave_Interval

The autosave function itself is in wp-includes/js/autosave(.dev).js

Leave a Comment