diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php
index ebda7a3..e81bfb9 100644
a
|
b
|
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql |
134 | 134 | } |
135 | 135 | } |
136 | 136 | // If this autosave isn't different from the current post, begone. |
137 | | if ( ! $notice ) |
| 137 | if ( ! apply_filters( 'autosave_is_different_notice', $notice, $autosave, $post ) ) { |
138 | 138 | wp_delete_post_revision( $autosave->ID ); |
| 139 | } |
139 | 140 | unset($autosave_field, $_autosave_field); |
140 | 141 | } |
141 | 142 | |
diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
index d230667..bbb7952 100644
a
|
b
|
function wp_create_post_autosave( $post_data ) { |
1530 | 1530 | $new_autosave['post_author'] = $post_author; |
1531 | 1531 | |
1532 | 1532 | // If the new autosave has the same content as the post, delete the autosave. |
1533 | | $post = get_post( $post_id ); |
| 1533 | $post = get_post( $post_id, ARRAY_A ); |
1534 | 1534 | $autosave_is_different = false; |
1535 | 1535 | foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields() ) ) as $field ) { |
1536 | | if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) { |
| 1536 | if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post[ $field ] ) ) { |
1537 | 1537 | $autosave_is_different = true; |
1538 | 1538 | break; |
1539 | 1539 | } |
1540 | 1540 | } |
1541 | 1541 | |
1542 | | if ( ! $autosave_is_different ) { |
| 1542 | if ( ! apply_filters( 'autosave_is_different', $autosave_is_different, $new_autosave, $post ) ) { |
1543 | 1543 | wp_delete_post_revision( $old_autosave->ID ); |
1544 | 1544 | return 0; |
1545 | 1545 | } |