From 631c9bb4d60d242432052f56c00768392f42a392 Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 24 Jun 2008 17:00:10 +0000 Subject: WP Merge to revision 8180 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1336 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/edit-form-advanced.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'wp-admin/edit-form-advanced.php') diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index e87945e..bb629f4 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -22,8 +22,17 @@ if ( !isset($post_ID) || 0 == $post_ID ) { $form_action = 'editpost'; $form_extra = ""; $autosave = wp_get_post_autosave( $post_id ); - if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) - $notice = sprintf( $notices[1], get_edit_post_link( $autosave->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); + } } ?> -- cgit