Changeset 11749 for trunk/wp-includes/functions.php
- Timestamp:
- 07/30/2009 01:39:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r11741 r11749 3340 3340 3341 3341 /** 3342 * Permanently deletes comments that have been scheduled for deleting. 3343 * Will do the same for posts, pages, etc in the future. 3342 * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS. 3344 3343 * 3345 * @access private3346 3344 * @since 2.9.0 3347 3345 * … … 3349 3347 */ 3350 3348 function wp_scheduled_delete() { 3351 $t o_delete = get_option('wp_scheduled_delete');3352 if ( !is_array($to_delete))3349 $trash_meta = get_option('wp_trash_meta'); 3350 if ( !is_array($trash_meta) ) 3353 3351 return; 3354 3352 3355 if ( !isset($to_delete['comments']) || !is_array($to_delete['comments']) ) 3356 $to_delete['comments'] = array(); 3357 3358 $delete_delay = defined('EMPTY_TRASH_TIMEOUT') ? (int) EMPTY_TRASH_TIMEOUT : (60*60*24*30); 3359 $deletetimestamp = time() - $delete_delay; 3360 foreach ($to_delete['comments'] as $comment_id => $timestamp) { 3361 if ($timestamp < $deletetimestamp) { 3362 wp_delete_comment($comment_id); 3363 unset($to_delete['comments'][$comment_id]); 3353 $delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS); 3354 3355 foreach ( $trash_meta['comments'] as $id => $meta ) { 3356 if ( $meta['time'] < $delete_timestamp ) { 3357 wp_delete_comment($id); 3358 unset($trash_meta['comments'][$id]); 3364 3359 } 3365 3360 } 3361 foreach ( $trash_meta['posts'] as $id => $meta ) { 3362 if ( $meta['time'] < $delete_timestamp ) { 3363 wp_delete_post($id); 3364 unset($to_delete['posts'][$id]); 3365 } 3366 } 3366 3367 3367 3368 update_option('wp_scheduled_delete', $to_delete);
Note: See TracChangeset
for help on using the changeset viewer.