Changeset 11945 for trunk/wp-includes/functions.php
- Timestamp:
- 09/17/2009 08:51:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r11930 r11945 3381 3381 } 3382 3382 3383 //Trashed Comments 3384 //TODO Come up with a better store for the comment trash meta. 3385 $trash_meta = get_option('wp_trash_meta'); 3386 if ( !is_array($trash_meta) ) 3387 return; 3388 3389 foreach ( (array) $trash_meta['comments'] as $id => $meta ) { 3390 if ( $meta['time'] < $delete_timestamp ) { 3391 wp_delete_comment($id); 3392 unset($trash_meta['comments'][$id]); 3393 } 3394 } 3395 3396 update_option('wp_trash_meta', $trash_meta); 3383 $comments_to_delete = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A); 3384 3385 foreach ( (array) $comments_to_delete as $comment ) { 3386 wp_delete_comment($comment['comment_id']); 3387 } 3397 3388 } 3398 3389 ?>
Note: See TracChangeset
for help on using the changeset viewer.