Changeset 11741 for trunk/wp-includes/functions.php
- Timestamp:
- 07/24/2009 07:23:11 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r11736 r11741 3329 3329 } 3330 3330 3331 3332 3333 3331 /** 3334 3332 * Strip close comment and close php tags from file headers used by WP … … 3340 3338 return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str)); 3341 3339 } 3342 ?> 3340 3341 /** 3342 * Permanently deletes comments that have been scheduled for deleting. 3343 * Will do the same for posts, pages, etc in the future. 3344 * 3345 * @access private 3346 * @since 2.9.0 3347 * 3348 * @return void 3349 */ 3350 function wp_scheduled_delete() { 3351 $to_delete = get_option('wp_scheduled_delete'); 3352 if (!is_array($to_delete)) 3353 return; 3354 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]); 3364 } 3365 } 3366 3367 update_option('wp_scheduled_delete', $to_delete); 3368 }
Note: See TracChangeset
for help on using the changeset viewer.