go back.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Post updated.');
$messages[6] = __('Post published.');
$messages[7] = __('Post saved.');
if ( isset($_GET['revision']) )
$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
$notice = false;
$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. View the autosave.' );
if ( 0 == $post_ID ) {
$form_action = 'post';
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
$form_extra = "";
$autosave = false;
} else {
$post_ID = (int) $post_ID;
$form_action = 'editpost';
$form_extra = "";
$autosave = wp_get_post_autosave( $post_id );
// Detect if there exists an autosave newer than the post and if that autosave is different than the post
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) {
foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) {
$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
break;
}
}
unset($autosave_field, $_autosave_field);
}
}
?>