WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/12/2012 06:49:48 PM (10 years ago)
Author:
ryan
Message:

Schedule auto-draft deletion from post-new.php instead of from admin.php. This provides better throttling for large multisite installs and reduces the risk of a delete avalanche.

fixes #19663

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r20449 r20453  
    33093309/**
    33103310 * 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
    33123311 *
    33133312 * @since 2.9.0
     
    33513350        }
    33523351    }
    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
    33583352}
    33593353
Note: See TracChangeset for help on using the changeset viewer.