Changeset 7907 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 05/08/2008 05:25:07 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/admin-ajax.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r7777 r7907 462 462 define( 'DOING_AUTOSAVE', true ); 463 463 464 $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' );464 $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' ); 465 465 global $current_user; 466 466 467 $_POST['post_status'] = 'draft';468 467 $_POST['post_category'] = explode(",", $_POST['catslist']); 469 468 $_POST['tags_input'] = explode(",", $_POST['tags_input']); … … 479 478 $supplemental = array(); 480 479 481 $id = 0;480 $id = $revision_id = 0; 482 481 if($_POST['post_ID'] < 0) { 482 $_POST['post_status'] = 'draft'; 483 483 $_POST['temp_ID'] = $_POST['post_ID']; 484 484 if ( $do_autosave ) { … … 511 511 die(__('You are not allowed to edit this post.')); 512 512 } 513 513 514 if ( $do_autosave ) { 514 $id = edit_post(); 515 // Drafts are just overwritten by autosave 516 if ( 'draft' == $post->post_status ) { 517 $id = edit_post(); 518 } else { // Non drafts are not overwritten. The autosave is stored in a special post revision. 519 $revision_id = wp_create_autosave( $post->ID ); 520 if ( is_wp_error($revision_id) ) 521 $id = $revision_id; 522 else 523 $id = $post->ID; 524 } 515 525 $data = $message; 516 526 } else {
Note: See TracChangeset
for help on using the changeset viewer.