Changeset 20440
- Timestamp:
- 04/11/2012 08:39:09 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r20308 r20440 418 418 419 419 if ( $create_in_db ) { 420 // Cleanup old auto-drafts more than 7 days old421 $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" );422 foreach ( (array) $old_posts as $delete )423 wp_delete_post( $delete, true ); // Force delete424 420 $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) ); 425 421 $post = get_post( $post_id ); -
trunk/wp-includes/functions.php
r20435 r20440 3309 3309 /** 3310 3310 * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS. 3311 * Deletes auto-drafts for new posts that are > 7 days old 3311 3312 * 3312 3313 * @since 2.9.0 … … 3350 3351 } 3351 3352 } 3353 3354 // Cleanup old auto-drafts more than 7 days old 3355 $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" ); 3356 foreach ( (array) $old_posts as $delete ) 3357 wp_delete_post( $delete, true ); // Force delete 3352 3358 } 3353 3359
Note: See TracChangeset
for help on using the changeset viewer.