Changeset 20453
- Timestamp:
- 04/12/2012 06:49:48 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post-new.php
r19712 r20453 40 40 wp_die( __( 'Cheatin’ uh?' ) ); 41 41 42 // Schedule auto-draft cleanup 43 if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) 44 wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' ); 45 42 46 wp_enqueue_script('autosave'); 43 47 -
trunk/wp-includes/default-filters.php
r20234 r20453 254 254 add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); 255 255 add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); 256 add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' ); 256 257 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 257 258 add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); -
trunk/wp-includes/functions.php
r20449 r20453 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 old3312 3311 * 3313 3312 * @since 2.9.0 … … 3351 3350 } 3352 3351 } 3353 3354 // Cleanup old auto-drafts more than 7 days old3355 $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 delete3358 3352 } 3359 3353 -
trunk/wp-includes/post.php
r20435 r20453 5165 5165 5166 5166 /** 5167 * Deletes auto-drafts for new posts that are > 7 days old 5168 * 5169 * @since 3.4.0 5170 */ 5171 function wp_delete_auto_drafts() { 5172 global $wpdb; 5173 5174 // Cleanup old auto-drafts more than 7 days old 5175 $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" ); 5176 foreach ( (array) $old_posts as $delete ) 5177 wp_delete_post( $delete, true ); // Force delete 5178 } 5179 5180 /** 5167 5181 * Filters the request to allow for the format prefix. 5168 5182 *
Note: See TracChangeset
for help on using the changeset viewer.