Remove old autosave collision code from edit_post(). props miqrogroove.

This code, which could block autosaves when drafts had future timestamps,
dates to before autosaves were saved as revisions and is no longer necessary.

fixes #21858.



git-svn-id: http://core.svn.wordpress.org/trunk@21949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-22 02:11:09 +00:00
parent 33af30eb7f
commit e4c209f18b
1 changed files with 0 additions and 10 deletions

View File

@ -162,16 +162,6 @@ function edit_post( $post_data = null ) {
wp_die( __('You are not allowed to edit this post.' )); wp_die( __('You are not allowed to edit this post.' ));
} }
// Autosave shouldn't save too soon after a real save
if ( 'autosave' == $post_data['action'] ) {
$post = get_post( $post_ID );
$now = time();
$then = strtotime($post->post_date_gmt . ' +0000');
$delta = AUTOSAVE_INTERVAL / 2;
if ( ($now - $then) < $delta )
return $post_ID;
}
$post_data = _wp_translate_postdata( true, $post_data ); $post_data = _wp_translate_postdata( true, $post_data );
if ( is_wp_error($post_data) ) if ( is_wp_error($post_data) )
wp_die( $post_data->get_error_message() ); wp_die( $post_data->get_error_message() );