Ticket #5459: autosave-array.diff
File autosave-array.diff, 1.3 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/post.php
106 106 wp_update_post( $_POST ); 107 107 108 108 // Reunite any orphaned attachments with their parent 109 if ( ! $draft_ids = get_user_option( 'autosave_draft_ids') )109 if ( !is_array( $draft_ids = get_user_option( 'autosave_draft_ids' ) ) ) 110 110 $draft_ids = array(); 111 111 if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 112 112 _relocate_children( $draft_temp_id, $post_ID ); … … 200 200 $temp_id = false; 201 201 if ( isset($_POST['temp_ID']) ) { 202 202 $temp_id = (int) $_POST['temp_ID']; 203 if ( ! $draft_ids = get_user_option( 'autosave_draft_ids') )203 if ( !is_array( $draft_ids = get_user_option( 'autosave_draft_ids' ) ) ) 204 204 $draft_ids = array(); 205 205 foreach ( $draft_ids as $temp => $real ) 206 206 if ( time() + $temp > 86400 ) // 1 day: $temp is equal to -1 * time( then ) … … 292 292 add_meta( $post_ID ); 293 293 294 294 // Reunite any orphaned attachments with their parent 295 if ( ! $draft_ids = get_user_option( 'autosave_draft_ids') )295 if ( !is_array( $draft_ids = get_user_option( 'autosave_draft_ids' ) ) ) 296 296 $draft_ids = array(); 297 297 if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 298 298 _relocate_children( $draft_temp_id, $post_ID );