Make WordPress Core


Ignore:
Timestamp:
07/24/2009 07:23:11 AM (17 years ago)
Author:
azaozz
Message:

"Trash" status for comments updates, props caesarsgrunt, see #4529

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r11731 r11741  
    17681768endif;
    17691769
    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.