Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

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

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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