diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index fc461fd9a5..bc05165399 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -11,7 +11,7 @@ jQuery(function($) { }); // called when autosaving pre-existing post -function autosave_saved(response) { +function autosave_saved(response, keepDisabled) { var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response var message = ''; @@ -41,13 +41,15 @@ function autosave_saved(response) { } if ( message ) { jQuery('#autosave').html(message); } // update autosave message else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } - autosave_enable_buttons(); // re-enable disabled form buttons + if ( !keepDisabled ) { + autosave_enable_buttons(); // re-enable disabled form buttons + } return res; } // called when autosaving new post function autosave_saved_new(response) { - var res = autosave_saved(response); // parse the ajax response do the above + var res = autosave_saved(response, true); // parse the ajax response do the above // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID if ( res && res.responses.length && !res.errors ) { var tempID = jQuery('#post_ID').val(); @@ -58,6 +60,7 @@ function autosave_saved_new(response) { this.href = this.href.replace(tempID, postID); }); } + autosave_enable_buttons(); // re-enable disabled form buttons } function autosave_update_post_ID( postID ) { diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 60a994f04b..a8b3a7b9d9 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -47,7 +47,7 @@ class WP_Scripts { 'broken' => __('An unidentified error has occurred.') ) ); - $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080416' ); + $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080422' ); $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306'); $this->localize( 'wp-ajax', 'WPAjaxL10n', array(