-function autosave_update_post_ID( postID ) {
- if ( !isNaN(postID) && postID > 0 ) {
- if ( postID == parseInt(jQuery('#post_ID').val(), 10) ) { return; } // no need to do this more than once
- jQuery('#post_ID').attr({name: "post_ID"});
- jQuery('#post_ID').val(postID);
- // We need new nonces
- jQuery.post(autosaveL10n.requestFile, {
- action: "autosave-generate-nonces",
- post_ID: postID,
- autosavenonce: jQuery('#autosavenonce').val(),
- post_type: jQuery('#post_type').val()
- }, function(html) {
- jQuery('#_wpnonce').val(html.updateNonce);
- jQuery('#delete-action a.submitdelete').attr('href', html.deleteURL);
- autosave_enable_buttons(); // re-enable disabled form buttons
- jQuery('#delete-action a.submitdelete').fadeIn();
- },
- 'json');
- jQuery('#hiddenaction').val('editpost');
- }
-}
-