Ticket #19663: patch_19663.diff
File patch_19663.diff, 1.7 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/post.php
415 415 $post_excerpt = esc_html( stripslashes( $_REQUEST['excerpt'] )); 416 416 417 417 if ( $create_in_db ) { 418 // Cleanup old auto-drafts more than 7 days old419 $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" );420 foreach ( (array) $old_posts as $delete )421 wp_delete_post( $delete, true ); // Force delete422 418 $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) ); 423 419 $post = get_post( $post_id ); 424 420 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) -
wp-includes/functions.php
3348 3348 3349 3349 /** 3350 3350 * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS. 3351 * Deletes auto-drafts for new posts that are > 7 days old 3351 3352 * 3352 3353 * @since 2.9.0 3353 3354 */ … … 3389 3390 wp_delete_comment($comment_id); 3390 3391 } 3391 3392 } 3393 3394 // Cleanup old auto-drafts more than 7 days old 3395 $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" ); 3396 foreach ( (array) $old_posts as $delete ) 3397 wp_delete_post( $delete, true ); // Force delete 3392 3398 } 3393 3399 3394 3400 /**