Changeset 24879 for branches/3.6/wp-admin/includes/post.php
- Timestamp:
- 07/29/2013 07:06:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.6/wp-admin/includes/post.php
r24842 r24879 1321 1321 $new_autosave['post_author'] = $post_author; 1322 1322 1323 // If the new autosave is the same content as the post, delete the old autosave. 1324 $post = get_post( $post_id ); 1325 $autosave_is_different = false; 1326 foreach ( array_keys( _wp_post_revision_fields() ) as $field ) { 1327 if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) { 1328 $autosave_is_different = true; 1329 break; 1330 } 1331 } 1332 1333 if ( ! $autosave_is_different ) { 1334 wp_delete_post_revision( $old_autosave->ID ); 1335 return; 1336 } 1337 1323 1338 return wp_update_post( $new_autosave ); 1324 1339 } 1325 1340 1326 1341 // _wp_put_post_revision() expects unescaped. 1327 $ _POST = wp_unslash($_POST);1342 $post_data = wp_unslash( $_POST ); 1328 1343 1329 1344 // Otherwise create the new autosave as a special post revision 1330 return _wp_put_post_revision( $ _POST, true );1345 return _wp_put_post_revision( $post_data, true ); 1331 1346 } 1332 1347
Note: See TracChangeset
for help on using the changeset viewer.