Changeset 11731 for trunk/wp-includes/pluggable.php
- Timestamp:
- 07/21/2009 03:11:12 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/pluggable.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pluggable.php
r11615 r11731 1768 1768 endif; 1769 1769 1770 ?> 1770 /** 1771 * Destroys comments which have previously been scheduled for destruction. 1772 * Will do the same for posts, pages, etc in the future. 1773 * 1774 * @access private 1775 * @since 2.9.0 1776 * 1777 * @return void 1778 */ 1779 function _scheduled_destruction() { 1780 $to_destroy = get_option('to_destroy'); 1781 if (!is_array($to_destroy)) 1782 return; 1783 1784 $deletetimestamp = time()-(60*60*24*30); 1785 foreach ($to_destroy['comments'] as $comment_id => $timestamp) { 1786 if ($timestamp < $deletetimestamp) { 1787 wp_delete_comment($comment_id); 1788 unset($to_destroy['comments'][$comment_id]); 1789 } 1790 } 1791 1792 update_option('to_destroy', $to_destroy); 1793 } 1794 add_action( '_scheduled_destruction', '_scheduled_destruction' ); 1795 if ( !wp_next_scheduled('_scheduled_destruction') && !defined('WP_INSTALLING') ) 1796 wp_schedule_event(time(), 'daily', '_scheduled_destruction'); 1797 1798
Note: See TracChangeset
for help on using the changeset viewer.