2

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

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

  • Thanks for the answer but that doesn't really help me since I don't want to turn of the auto save function. I'll have a look at the js file and see what I can do. – Stephan S. Dec 6 '12 at 20:39
  • Yes I know :( I'm pretty sure the answer is in the js file but I'm not very skilled in JS so I can't figure it out. You might be able to trigger autosave() a function that might work – janw Dec 7 '12 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.