<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[11741] trunk: &quot;Trash&quot; status for comments updates, props caesarsgrunt,
  see #4529</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/11741">11741</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-07-24 07:23:11 +0000 (Fri, 24 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>&quot;Trash&quot; status for comments updates, props caesarsgrunt, see <a href="http://trac.wordpress.org/ticket/4529">#4529</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmineditcommentsphp">trunk/wp-admin/edit-comments.php</a></li>
<li><a href="#trunkwpadminincludesdashboardphp">trunk/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpincludescommentphp">trunk/wp-includes/comment.php</a></li>
<li><a href="#trunkwpincludescronphp">trunk/wp-includes/cron.php</a></li>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
<li><a href="#trunkwpincludespluggablephp">trunk/wp-includes/pluggable.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmineditcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-comments.php (11740 => 11741)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-comments.php        2009-07-22 22:33:11 UTC (rev 11740)
+++ trunk/wp-admin/edit-comments.php        2009-07-24 07:23:11 UTC (rev 11741)
</span><span class="lines">@@ -250,16 +250,19 @@
</span><span class="cx"> &lt;?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?&gt;
</span><span class="cx"> &lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Unapprove'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><del>-&lt;?php if ( 'approved' != $comment_status ): ?&gt;
</del><ins>+&lt;?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?&gt;
</ins><span class="cx"> &lt;option value=&quot;approve&quot;&gt;&lt;?php _e('Approve'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><del>-&lt;?php if ( 'spam' != $comment_status ): ?&gt;
</del><ins>+&lt;?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?&gt;
</ins><span class="cx"> &lt;option value=&quot;markspam&quot;&gt;&lt;?php _e('Mark as Spam'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><ins>+&lt;?php if ( 'deleted' == $comment_status ): ?&gt;
+&lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Return to Pending'); ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
</ins><span class="cx"> &lt;?php if ( 'deleted' == $comment_status || 'spam' == $comment_status ): ?&gt;
</span><span class="cx"> &lt;option value=&quot;destroy&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php else: ?&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
</ins><span class="cx"> &lt;?php endif; ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><span class="lines">@@ -286,10 +289,12 @@
</span><span class="cx">         &lt;input type=&quot;hidden&quot; name=&quot;apage&quot; value=&quot;&lt;?php echo esc_attr( absint( $_GET['apage'] ) ); ?&gt;&quot; /&gt;
</span><span class="cx"> &lt;?php }
</span><span class="cx"> 
</span><del>-if ( 'spam' == $comment_status || 'deleted' == $comment_status ) {
</del><ins>+if ( ( 'spam' == $comment_status || 'deleted' == $comment_status) &amp;&amp; current_user_can ('moderate_comments') ) {
</ins><span class="cx">         wp_nonce_field('bulk-destroy', '_destroy_nonce');
</span><del>-        if ( current_user_can ('moderate_comments')) { ?&gt;
</del><ins>+    if ( 'spam' == $comment_status ) { ?&gt;
</ins><span class="cx">                 &lt;input type=&quot;submit&quot; name=&quot;destroy_all&quot; id=&quot;destroy_all&quot; value=&quot;&lt;?php esc_attr_e('Permanently Delete All'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><ins>+&lt;?php } elseif ( 'deleted' == $comment_status ) { ?&gt;
+                &lt;input type=&quot;submit&quot; name=&quot;destroy_all&quot; id=&quot;destroy_all&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-primary apply&quot; /&gt;
</ins><span class="cx"> &lt;?php }
</span><span class="cx"> } ?&gt;
</span><span class="cx"> &lt;?php do_action('manage_comments_nav', $comment_status); ?&gt;
</span><span class="lines">@@ -341,22 +346,27 @@
</span><span class="cx"> &lt;?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?&gt;
</span><span class="cx"> &lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Unapprove'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><del>-&lt;?php if ( 'approved' != $comment_status ): ?&gt;
</del><ins>+&lt;?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?&gt;
</ins><span class="cx"> &lt;option value=&quot;approve&quot;&gt;&lt;?php _e('Approve'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><del>-&lt;?php if ( 'spam' != $comment_status ): ?&gt;
</del><ins>+&lt;?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?&gt;
</ins><span class="cx"> &lt;option value=&quot;markspam&quot;&gt;&lt;?php _e('Mark as Spam'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><ins>+&lt;?php if ( 'deleted' == $comment_status ): ?&gt;
+&lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Return to Pending'); ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
</ins><span class="cx"> &lt;?php if ( 'deleted' == $comment_status || 'spam' == $comment_status ): ?&gt;
</span><span class="cx"> &lt;option value=&quot;destroy&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php else: ?&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
</ins><span class="cx"> &lt;?php endif; ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( 'spam' == $comment_status || 'deleted' == $comment_status ) { ?&gt;
-&lt;input type=&quot;submit&quot; name=&quot;destroy_all2&quot; id=&quot;destroy_all2&quot; value=&quot;&lt;?php esc_attr_e('Permanently Delete All'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</del><ins>+&lt;?php if ( 'spam' == $comment_status ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;destroy_all2&quot; id=&quot;destroy_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Quarantine'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } elseif ( 'deleted' == $comment_status ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;destroy_all2&quot; id=&quot;destroy_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</ins><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;?php do_action('manage_comments_nav', $comment_status); ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span></span></pre></div>
<a id="trunkwpadminincludesdashboardphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/dashboard.php (11740 => 11741)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/dashboard.php        2009-07-22 22:33:11 UTC (rev 11740)
+++ trunk/wp-admin/includes/dashboard.php        2009-07-24 07:23:11 UTC (rev 11741)
</span><span class="lines">@@ -539,10 +539,9 @@
</span><span class="cx">                 $actions['approve'] = &quot;&lt;a href='$approve_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='&quot; . __( 'Approve this comment' ) . &quot;'&gt;&quot; . __( 'Approve' ) . '&lt;/a&gt;';
</span><span class="cx">                 $actions['unapprove'] = &quot;&lt;a href='$unapprove_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='&quot; . __( 'Unapprove this comment' ) . &quot;'&gt;&quot; . __( 'Unapprove' ) . '&lt;/a&gt;';
</span><span class="cx">                 $actions['edit'] = &quot;&lt;a href='comment.php?action=editcomment&amp;amp;c={$comment-&gt;comment_ID}' title='&quot; . __('Edit comment') . &quot;'&gt;&quot;. __('Edit') . '&lt;/a&gt;';
</span><del>-                //$actions['quickedit'] = '&lt;a onclick=&quot;commentReply.open(\''.$comment-&gt;comment_ID.'\',\''.$comment-&gt;comment_post_ID.'\',\'edit\');return false;&quot; class=&quot;vim-q&quot; title=&quot;'.__('Quick Edit').'&quot; href=&quot;#&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
</del><span class="cx">                 $actions['reply'] = '&lt;a onclick=&quot;commentReply.open(\''.$comment-&gt;comment_ID.'\',\''.$comment-&gt;comment_post_ID.'\');return false;&quot; class=&quot;vim-r hide-if-no-js&quot; title=&quot;'.__('Reply to this comment').'&quot; href=&quot;#&quot;&gt;' . __('Reply') . '&lt;/a&gt;';
</span><span class="cx">                 $actions['spam'] = &quot;&lt;a href='$spam_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::spam=1 vim-s vim-destructive' title='&quot; . __( 'Mark this comment as spam' ) . &quot;'&gt;&quot; . /* translators: mark as spam link */  _x( 'Spam', 'verb' ) . '&lt;/a&gt;';
</span><del>-                $actions['delete'] = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID delete vim-d vim-destructive'&gt;&quot; . __('Delete') . '&lt;/a&gt;';
</del><ins>+                $actions['delete'] = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID delete vim-d vim-destructive'&gt;&quot; . __('Move to Trash') . '&lt;/a&gt;';
</ins><span class="cx"> 
</span><span class="cx">                 $actions = apply_filters( 'comment_row_actions', $actions, $comment );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (11740 => 11741)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2009-07-22 22:33:11 UTC (rev 11740)
+++ trunk/wp-admin/includes/template.php        2009-07-24 07:23:11 UTC (rev 11741)
</span><span class="lines">@@ -2159,7 +2159,7 @@
</span><span class="cx">                                                         $actions['delete'] = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::deleted=1 delete vim-d vim-destructive'&gt;&quot; . __('Delete Permanently') . '&lt;/a&gt;';
</span><span class="cx">                                                 } else {
</span><span class="cx">                                                         $actions['spam'] = &quot;&lt;a href='$spam_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::spam=1 vim-s vim-destructive' title='&quot; . __( 'Mark this comment as spam' ) . &quot;'&gt;&quot; . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '&lt;/a&gt;';
</span><del>-                                                        $actions['delete'] = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID delete vim-d vim-destructive'&gt;&quot; . __('Delete') . '&lt;/a&gt;';
</del><ins>+                                                        $actions['delete'] = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID delete vim-d vim-destructive'&gt;&quot; . __('Move to Trash') . '&lt;/a&gt;';
</ins><span class="cx">                                                 }
</span><span class="cx"> 
</span><span class="cx">                                                 $actions['edit'] = &quot;&lt;a href='comment.php?action=editcomment&amp;amp;c={$comment-&gt;comment_ID}' title='&quot; . __('Edit comment') . &quot;'&gt;&quot;. __('Edit') . '&lt;/a&gt;';
</span></span></pre></div>
<a id="trunkwpincludescommentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/comment.php (11740 => 11741)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/comment.php        2009-07-22 22:33:11 UTC (rev 11740)
+++ trunk/wp-includes/comment.php        2009-07-24 07:23:11 UTC (rev 11741)
</span><span class="lines">@@ -743,7 +743,7 @@
</span><span class="cx">         global $wpdb;
</span><span class="cx">         do_action('delete_comment', $comment_id);
</span><span class="cx">         
</span><del>-        wp_unschedule_comment_destruction($comment_id);
</del><ins>+        wp_unschedule_comment_delete($comment_id);
</ins><span class="cx"> 
</span><span class="cx">         $comment = get_comment($comment_id);
</span><span class="cx"> 
</span><span class="lines">@@ -1037,7 +1037,7 @@
</span><span class="cx">  */
</span><span class="cx"> function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
</span><span class="cx">         global $wpdb;
</span><del>-        wp_unschedule_comment_destruction($comment_id);
</del><ins>+        wp_unschedule_comment_delete($comment_id);
</ins><span class="cx">         
</span><span class="cx">         $status = '0';
</span><span class="cx">         switch ( $comment_status ) {
</span><span class="lines">@@ -1058,7 +1058,7 @@
</span><span class="cx">                         if (wp_get_comment_status($comment_id) == 'deleted' || wp_get_comment_status($comment_id) == 'spam')
</span><span class="cx">                                 return wp_delete_comment($comment_id);
</span><span class="cx">                         $status = 'deleted';
</span><del>-                        wp_schedule_comment_destruction($comment_id);
</del><ins>+                        wp_schedule_comment_delete($comment_id);
</ins><span class="cx">                         break;
</span><span class="cx">                 default:
</span><span class="cx">                         return false;
</span><span class="lines">@@ -1091,14 +1091,14 @@
</span><span class="cx">  * @param int $comment_id Comment ID.
</span><span class="cx">  * @return void
</span><span class="cx">  */
</span><del>-function wp_schedule_comment_destruction($comment_id) {
-        $to_destroy = get_option('to_destroy');
-        if (!is_array($to_destroy))
-                $to_destroy = array();
</del><ins>+function wp_schedule_comment_delete($comment_id) {
+        $to_delete = get_option('wp_scheduled_delete');
+        if ( !is_array($to_delete) )
+                $to_delete = array();
</ins><span class="cx">         
</span><del>-        $to_destroy['comments'][$comment_id] = time();
</del><ins>+        $to_delete['comments'][$comment_id] = time();
</ins><span class="cx">         
</span><del>-        update_option('to_destroy', $to_destroy);
</del><ins>+        update_option('wp_scheduled_delete', $to_delete);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1109,14 +1109,14 @@
</span><span class="cx">  * @param int $comment_id Comment ID.
</span><span class="cx">  * @return void
</span><span class="cx">  */
</span><del>-function wp_unschedule_comment_destruction($comment_id) {
-        $to_destroy = get_option('to_destroy');
-        if (!is_array($to_destroy))
</del><ins>+function wp_unschedule_comment_delete($comment_id) {
+        $to_delete = get_option('wp_scheduled_delete');
+        if ( !is_array($to_delete) )
</ins><span class="cx">                 return;
</span><span class="cx">         
</span><del>-        unset($to_destroy['comments'][$comment_id]);
</del><ins>+        unset($to_delete['comments'][$comment_id]);
</ins><span class="cx">         
</span><del>-        update_option('to_destroy', $to_destroy);
</del><ins>+        update_option('wp_scheduled_delete', $to_delete);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkwpincludescronphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/cron.php (11740 => 11741)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/cron.php        2009-07-22 22:33:11 UTC (rev 11740)
+++ trunk/wp-includes/cron.php        2009-07-24 07:23:11 UTC (rev 11741)
</span><span class="lines">@@ -394,4 +394,6 @@
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-?&gt;
</del><ins>+add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );
+if ( !wp_next_scheduled('wp_scheduled_delete') &amp;&amp; !defined('WP_INSTALLING') )
+        wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
</ins></span></pre></div>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (11740 => 11741)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php        2009-07-22 22:33:11 UTC (rev 11740)
+++ trunk/wp-includes/functions.php        2009-07-24 07:23:11 UTC (rev 11741)
</span><span class="lines">@@ -3328,8 +3328,6 @@
</span><span class="cx">         return join( &quot;\n&quot;, $structure );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-
</del><span class="cx"> /**
</span><span class="cx">  * Strip close comment and close php tags from file headers used by WP
</span><span class="cx">  * See http://core.trac.wordpress.org/ticket/8497
</span><span class="lines">@@ -3339,4 +3337,32 @@
</span><span class="cx"> function _cleanup_header_comment($str) {
</span><span class="cx">         return trim(preg_replace(&quot;/\s*(?:\*\/|\?&gt;).*/&quot;, '', $str));
</span><span class="cx"> }
</span><del>-?&gt;
</del><ins>+
+/**
+ * Permanently deletes comments that have been scheduled for deleting.
+ * Will do the same for posts, pages, etc in the future.
+ * 
+ * @access private
+ * @since 2.9.0
+ *
+ * @return void
+ */
+function wp_scheduled_delete() {
+        $to_delete = get_option('wp_scheduled_delete');
+        if (!is_array($to_delete))
+                return;
+
+        if ( !isset($to_delete['comments']) || !is_array($to_delete['comments']) )
+                $to_delete['comments'] = array();
+
+        $delete_delay = defined('EMPTY_TRASH_TIMEOUT') ? (int) EMPTY_TRASH_TIMEOUT : (60*60*24*30);
+        $deletetimestamp = time() - $delete_delay;
+        foreach ($to_delete['comments'] as $comment_id =&gt; $timestamp) {
+                if ($timestamp &lt; $deletetimestamp) {
+                        wp_delete_comment($comment_id);
+                        unset($to_delete['comments'][$comment_id]);
+                }
+        }
+
+        update_option('wp_scheduled_delete', $to_delete);
+}
</ins></span></pre></div>
<a id="trunkwpincludespluggablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pluggable.php (11740 => 11741)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pluggable.php        2009-07-22 22:33:11 UTC (rev 11740)
+++ trunk/wp-includes/pluggable.php        2009-07-24 07:23:11 UTC (rev 11741)
</span><span class="lines">@@ -1767,32 +1767,3 @@
</span><span class="cx"> }
</span><span class="cx"> endif;
</span><span class="cx"> 
</span><del>-/**
- * Destroys comments which have previously been scheduled for destruction.
- * Will do the same for posts, pages, etc in the future.
- * 
- * @access private
- * @since 2.9.0
- *
- * @return void
- */
-function _scheduled_destruction() {
-        $to_destroy = get_option('to_destroy');
-        if (!is_array($to_destroy))
-                return;
-
-        $deletetimestamp = time()-(60*60*24*30);
-        foreach ($to_destroy['comments'] as $comment_id =&gt; $timestamp) {
-                if ($timestamp &lt; $deletetimestamp) {
-                        wp_delete_comment($comment_id);
-                        unset($to_destroy['comments'][$comment_id]);
-                }
-        }
-
-        update_option('to_destroy', $to_destroy);
-}
-add_action( '_scheduled_destruction', '_scheduled_destruction' );
-if ( !wp_next_scheduled('_scheduled_destruction') &amp;&amp; !defined('WP_INSTALLING') )
-        wp_schedule_event(time(), 'daily', '_scheduled_destruction');
-
-
</del></span></pre>
</div>
</div>

</body>
</html>