Ticket #16785: 16785.diff
File 16785.diff, 1.7 KB (added by , 13 years ago) |
---|
-
wp-includes/functions.php
4255 4255 4256 4256 /** 4257 4257 * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS. 4258 * Also removes auto-drafts which are more than 7 days old 4258 4259 * 4259 4260 * @since 2.9.0 4260 4261 */ … … 4296 4297 wp_delete_comment($comment_id); 4297 4298 } 4298 4299 } 4300 4301 // Cleanup old auto-drafts 4302 $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" ); 4303 foreach ( (array) $old_posts as $delete ) 4304 wp_delete_post( $delete, true ); // Force delete 4299 4305 } 4300 4306 4301 4307 /** -
wp-admin/includes/post.php
397 397 $post_excerpt = esc_html( stripslashes( $_REQUEST['excerpt'] )); 398 398 399 399 if ( $create_in_db ) { 400 // Cleanup old auto-drafts more than 7 days old401 $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" );402 foreach ( (array) $old_posts as $delete )403 wp_delete_post( $delete, true ); // Force delete404 400 $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) ); 405 401 $post = get_post( $post_id ); 406 402 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) )