Changeset 23735 for trunk/wp-admin/includes/post.php
- Timestamp:
- 03/16/2013 09:15:43 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r23733 r23735 1281 1281 return $translated; 1282 1282 1283 // Only store one autosave. If there is already an autosave, overwrite it. 1284 if ( $old_autosave = wp_get_post_autosave( $post_id ) ) { 1283 $post_author = get_current_user_id(); 1284 1285 // Store one autosave per author. If there is already an autosave, overwrite it. 1286 if ( $old_autosave = wp_get_post_autosave( $post_id, $post_author ) ) { 1285 1287 $new_autosave = _wp_post_revision_fields( $_POST, true ); 1286 1288 $new_autosave['ID'] = $old_autosave->ID; 1287 $new_autosave['post_author'] = get_current_user_id();1289 $new_autosave['post_author'] = $post_author; 1288 1290 return wp_update_post( $new_autosave ); 1289 1291 } … … 1340 1342 } 1341 1343 1342 if ( 'draft' == $post->post_status ) { 1344 $user_id = get_current_user_id(); 1345 if ( 'draft' == $post->post_status && $user_id == $post->post_author ) { 1343 1346 $id = edit_post(); 1344 1347 } else { // Non drafts are not overwritten. The autosave is stored in a special post revision. … … 1351 1354 wp_die( $id->get_error_message() ); 1352 1355 1353 if ( $_POST['post_status'] == 'draft' ) {1356 if ( $_POST['post_status'] == 'draft' && $user_id == $post->post_author ) { 1354 1357 $url = add_query_arg( 'preview', 'true', get_permalink($id) ); 1355 1358 } else {
Note: See TracChangeset
for help on using the changeset viewer.