<!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>[11749] trunk: Trash status updates for posts, pages,
  comments and attachments, props caesarsgrunt, see #4529</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/11749">11749</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-07-30 13:39:34 +0000 (Thu, 30 Jul 2009)</dd>
</dl>

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadmincommentphp">trunk/wp-admin/comment.php</a></li>
<li><a href="#trunkwpadmineditattachmentrowsphp">trunk/wp-admin/edit-attachment-rows.php</a></li>
<li><a href="#trunkwpadmineditcommentsphp">trunk/wp-admin/edit-comments.php</a></li>
<li><a href="#trunkwpadmineditformadvancedphp">trunk/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunkwpadmineditformcommentphp">trunk/wp-admin/edit-form-comment.php</a></li>
<li><a href="#trunkwpadmineditpageformphp">trunk/wp-admin/edit-page-form.php</a></li>
<li><a href="#trunkwpadmineditpagesphp">trunk/wp-admin/edit-pages.php</a></li>
<li><a href="#trunkwpadmineditphp">trunk/wp-admin/edit.php</a></li>
<li><a href="#trunkwpadminincludesdashboardphp">trunk/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminjscommondevjs">trunk/wp-admin/js/common.dev.js</a></li>
<li><a href="#trunkwpadminjscommonjs">trunk/wp-admin/js/common.js</a></li>
<li><a href="#trunkwpadminjseditcommentsdevjs">trunk/wp-admin/js/edit-comments.dev.js</a></li>
<li><a href="#trunkwpadminjseditcommentsjs">trunk/wp-admin/js/edit-comments.js</a></li>
<li><a href="#trunkwpadminmediaphp">trunk/wp-admin/media.php</a></li>
<li><a href="#trunkwpadminpagephp">trunk/wp-admin/page.php</a></li>
<li><a href="#trunkwpadminpostphp">trunk/wp-admin/post.php</a></li>
<li><a href="#trunkwpadminuploadphp">trunk/wp-admin/upload.php</a></li>
<li><a href="#trunkwpadminwpadmincss">trunk/wp-admin/wp-admin.css</a></li>
<li><a href="#trunkwpappphp">trunk/wp-app.php</a></li>
<li><a href="#trunkwpincludescommentphp">trunk/wp-includes/comment.php</a></li>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludesqueryphp">trunk/wp-includes/query.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwpsettingsphp">trunk/wp-settings.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/admin-ajax.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -181,18 +181,27 @@
</span><span class="cx"> $id = isset($_POST['id'])? (int) $_POST['id'] : 0;
</span><span class="cx"> switch ( $action = $_POST['action'] ) :
</span><span class="cx"> case 'delete-comment' : // On success, die with time() instead of 1
</span><del>-        check_ajax_referer( &quot;delete-comment_$id&quot; );
</del><span class="cx">         if ( !$comment = get_comment( $id ) )
</span><span class="cx">                 die( (string) time() );
</span><span class="cx">         if ( !current_user_can( 'edit_post', $comment-&gt;comment_post_ID ) )
</span><span class="cx">                 die('-1');
</span><span class="cx"> 
</span><del>-        if ( isset($_POST['spam']) &amp;&amp; 1 == $_POST['spam'] ) {
</del><ins>+        if ( isset($_POST['trash']) &amp;&amp; 1 == $_POST['trash'] ) {
+                check_ajax_referer( &quot;trash-comment_$id&quot; );
+                if ( 'trash' == wp_get_comment_status( $comment-&gt;comment_ID ) )
+                        die( (string) time() );
+                $r = wp_trash_comment( $comment-&gt;comment_ID );
+        } elseif ( isset($_POST['untrash']) &amp;&amp; 1 == $_POST['untrash'] ) {
+                check_ajax_referer( &quot;untrash-comment_$id&quot; );
+                $r = wp_untrash_comment( $comment-&gt;comment_ID );
+        } elseif ( isset($_POST['spam']) &amp;&amp; 1 == $_POST['spam'] ) {
+                check_ajax_referer( &quot;delete-comment_$id&quot; );
</ins><span class="cx">                 if ( 'spam' == wp_get_comment_status( $comment-&gt;comment_ID ) )
</span><span class="cx">                         die( (string) time() );
</span><span class="cx">                 $r = wp_set_comment_status( $comment-&gt;comment_ID, 'spam' );
</span><span class="cx">         } else {
</span><del>-                $r = wp_set_comment_status( $comment-&gt;comment_ID, 'delete' );
</del><ins>+                check_ajax_referer( &quot;delete-comment_$id&quot; );
+                $r = wp_delete_comment( $comment-&gt;comment_ID );
</ins><span class="cx">         }
</span><span class="cx">         if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts
</span><span class="cx">                 _wp_ajax_delete_comment_response( $comment-&gt;comment_ID );
</span></span></pre></div>
<a id="trunkwpadmincommentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/comment.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/comment.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/comment.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx">         if ( !current_user_can('edit_post', $comment-&gt;comment_post_ID) )
</span><span class="cx">                 comment_footer_die( __('You are not allowed to edit comments on this post.') );
</span><span class="cx"> 
</span><del>-        if ( 'deleted' == $comment-&gt;comment_status )
-                comment_footer_die( __('This comment has been deleted. Please move it out of the Trash if you want to edit it.') );
</del><ins>+        if ( 'trash' == $comment-&gt;comment_status )
+                comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
</ins><span class="cx">         
</span><span class="cx">         $comment = get_comment_to_edit( $comment_id );
</span><span class="cx"> 
</span><span class="lines">@@ -166,6 +166,35 @@
</span><span class="cx">         die;
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+case 'trashcomment' :
+case 'untrashcomment' :
+        $comment_id = absint( $_REQUEST['c'] );
+        $noredir = isset($_REQUEST['noredir']);
+        
+        if (!$comment = get_comment($comment_id))
+                comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' &lt;a href=&quot;%s&quot;&gt;'.__('Go back').'&lt;/a&gt;!', 'edit-comments.php') );
+        if (!current_user_can('edit_post', $comment-&gt;comment_post_ID ))
+                comment_footer_die( __('You are not allowed to edit comments on this post.') );
+        
+        if ($action == 'trashcomment') {
+                check_admin_referer( 'trash-comment_' . $comment_id );
+                wp_trash_comment($comment_id);
+        }
+        else {
+                check_admin_referer( 'untrash-comment_' . $comment_id );
+                wp_untrash_comment($comment_id);
+        }
+        
+        if ('' != wp_get_referer() &amp;&amp; false == $noredir &amp;&amp; false === strpos(wp_get_referer(), 'comment.php' ))
+                wp_redirect( wp_get_referer() );
+        else if ('' != wp_get_original_referer() &amp;&amp; false == $noredir)
+                wp_redirect(wp_get_original_referer());
+        else
+                wp_redirect(admin_url('edit-comments.php'));
+
+        die;
+        break;
+
</ins><span class="cx"> case 'unapprovecomment' :
</span><span class="cx">         $comment_id = absint( $_GET['c'] );
</span><span class="cx">         check_admin_referer( 'unapprove-comment_' . $comment_id );
</span></span></pre></div>
<a id="trunkwpadmineditattachmentrowsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-attachment-rows.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-attachment-rows.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/edit-attachment-rows.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -28,12 +28,18 @@
</span><span class="cx"> $alt = '';
</span><span class="cx"> $posts_columns = get_column_headers('upload');
</span><span class="cx"> $hidden = get_hidden_columns('upload');
</span><del>-while (have_posts()) : the_post();
</del><ins>+
+while ( have_posts() ) : the_post();
+
+if ( $is_trash &amp;&amp; $post-&gt;post_status != 'trash' )
+        continue;
+elseif ( !$is_trash &amp;&amp; $post-&gt;post_status == 'trash' )
+        continue;
+
</ins><span class="cx"> $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
</span><span class="cx"> global $current_user;
</span><span class="cx"> $post_owner = ( $current_user-&gt;ID == $post-&gt;post_author ? 'self' : 'other' );
</span><span class="cx"> $att_title = _draft_or_post_title();
</span><del>-
</del><span class="cx"> ?&gt;
</span><span class="cx">         &lt;tr id='post-&lt;?php echo $id; ?&gt;' class='&lt;?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post-&gt;post_status ); ?&gt;' valign=&quot;top&quot;&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -60,13 +66,15 @@
</span><span class="cx">                 ?&gt;
</span><span class="cx">                 &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php
</span><span class="cx">                         if ( $thumb = wp_get_attachment_image( $post-&gt;ID, array(80, 60), true ) ) {
</span><ins>+                                if ( $is_trash ) echo $thumb;
+                                else {
</ins><span class="cx"> ?&gt;
</span><del>-
</del><span class="cx">                                 &lt;a href=&quot;media.php?action=edit&amp;amp;attachment_id=&lt;?php the_ID(); ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $att_title)); ?&gt;&quot;&gt;
</span><span class="cx">                                         &lt;?php echo $thumb; ?&gt;
</span><span class="cx">                                 &lt;/a&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php                        }
</span><ins>+                        }
</ins><span class="cx">                 ?&gt;&lt;/td&gt;
</span><span class="cx">                 &lt;?php
</span><span class="cx">                 // TODO
</span><span class="lines">@@ -74,16 +82,21 @@
</span><span class="cx"> 
</span><span class="cx">         case 'media':
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;a href=&quot;&lt;?php echo get_edit_post_link( $post-&gt;ID ); ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $att_title)); ?&gt;&quot;&gt;&lt;?php echo $att_title; ?&gt;&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
</del><ins>+                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( $is_trash ) echo $att_title; else { ?&gt;&lt;a href=&quot;&lt;?php echo get_edit_post_link( $post-&gt;ID ); ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $att_title)); ?&gt;&quot;&gt;&lt;?php echo $att_title; ?&gt;&lt;/a&gt;&lt;?php } ?&gt;&lt;/strong&gt;&lt;br /&gt;
</ins><span class="cx">                 &lt;?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post-&gt;ID))); ?&gt;
</span><span class="cx">                 &lt;p&gt;
</span><span class="cx">                 &lt;?php
</span><span class="cx">                 $actions = array();
</span><del>-                if ( current_user_can('edit_post', $post-&gt;ID) )
-                        $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
-                if ( current_user_can('delete_post', $post-&gt;ID) )
-                        $actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . esc_js(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
-                $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
</del><ins>+                if ( $is_trash &amp;&amp; current_user_can('delete_post', $post-&gt;ID) ) {
+                        $actions['untrash'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=untrash&amp;amp;post=$post-&gt;ID&quot;, 'untrash-post_' . $post-&gt;ID) . &quot;'&gt;&quot; . __('Restore') . &quot;&lt;/a&gt;&quot;;
+                        $actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID) . &quot;'&gt;&quot; . __('Delete Permanently') . &quot;&lt;/a&gt;&quot;;
+                } else {
+                        if ( current_user_can('edit_post', $post-&gt;ID) )
+                                $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+                        if ( current_user_can('delete_post', $post-&gt;ID) )
+                                $actions['trash'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=trash&amp;amp;post=$post-&gt;ID&quot;, 'trash-post_' . $post-&gt;ID) . &quot;'&gt;&quot; . __('Trash') . &quot;&lt;/a&gt;&quot;;
+                        $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
+                }
</ins><span class="cx">                 $action_count = count($actions);
</span><span class="cx">                 $i = 0;
</span><span class="cx">                 echo '&lt;div class=&quot;row-actions&quot;&gt;';
</span></span></pre></div>
<a id="trunkwpadmineditcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-comments.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-comments.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/edit-comments.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -14,20 +14,20 @@
</span><span class="cx"> 
</span><span class="cx"> $post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
</span><span class="cx"> 
</span><del>-if ( isset($_REQUEST['doaction']) ||  isset($_REQUEST['doaction2']) || isset($_REQUEST['destroy_all']) || isset($_REQUEST['destroy_all2']) ) {
</del><ins>+if ( isset($_REQUEST['doaction']) ||  isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
</ins><span class="cx">         check_admin_referer('bulk-comments');
</span><span class="cx">         
</span><del>-        if ((isset($_REQUEST['destroy_all']) || isset($_REQUEST['destroy_all2'])) &amp;&amp; !empty($_REQUEST['pagegen_timestamp'])) {
</del><ins>+        if ((isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) &amp;&amp; !empty($_REQUEST['pagegen_timestamp'])) {
</ins><span class="cx">                 $comment_status = $wpdb-&gt;escape($_REQUEST['comment_status']);
</span><span class="cx">                 $delete_time = $wpdb-&gt;escape($_REQUEST['pagegen_timestamp']);
</span><span class="cx">                 $comment_ids = $wpdb-&gt;get_col( &quot;SELECT comment_ID FROM $wpdb-&gt;comments WHERE comment_approved = '$comment_status' AND '$delete_time' &gt; comment_date_gmt&quot; );
</span><del>-                $doaction = 'destroy';
</del><ins>+                $doaction = 'delete';
</ins><span class="cx">         } elseif (($_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1) &amp;&amp; isset($_REQUEST['delete_comments'])) {
</span><span class="cx">                 $comment_ids = $_REQUEST['delete_comments'];
</span><span class="cx">                 $doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2'];
</span><span class="cx">         } else wp_redirect($_SERVER['HTTP_REFERER']);
</span><span class="cx">         
</span><del>-        $approved = $unapproved = $spammed = $deleted = $destroyed = 0;
</del><ins>+        $approved = $unapproved = $spammed = $trashed = $untrashed = $deleted = 0;
</ins><span class="cx">         
</span><span class="cx">         foreach ($comment_ids as $comment_id) { // Check the permissions on each
</span><span class="cx">                 $_post_id = (int) $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT comment_post_ID FROM $wpdb-&gt;comments WHERE comment_ID = %d&quot;, $comment_id) );
</span><span class="lines">@@ -48,18 +48,22 @@
</span><span class="cx">                                 wp_set_comment_status($comment_id, 'spam');
</span><span class="cx">                                 $spammed++;
</span><span class="cx">                                 break;
</span><ins>+                        case 'trash' :
+                                wp_trash_comment($comment_id);
+                                $trashed++;
+                                break;
+                        case 'untrash' :
+                                wp_untrash_comment($comment_id);
+                                $untrashed++;
+                                break;
</ins><span class="cx">                         case 'delete' :
</span><del>-                                wp_set_comment_status($comment_id, 'delete');
</del><ins>+                                wp_delete_comment($comment_id);
</ins><span class="cx">                                 $deleted++;
</span><span class="cx">                                 break;
</span><del>-                        case 'destroy' :
-                                wp_set_comment_status($comment_id, 'delete');
-                                $destroyed++;
-                                break;
</del><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $redirect_to = 'edit-comments.php?approved=' . $approved . '&amp;unapproved=' . $unapproved . '&amp;spam=' . $spammed . '&amp;deleted=' . $deleted . '&amp;destroyed=' . $destroyed;
</del><ins>+        $redirect_to = 'edit-comments.php?approved=' . $approved . '&amp;unapproved=' . $unapproved . '&amp;spam=' . $spammed . '&amp;trashed=' . $trashed . '&amp;untrashed=' . $untrashed . '&amp;deleted=' . $deleted;
</ins><span class="cx">         if ( $post_id )
</span><span class="cx">                 $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
</span><span class="cx">         if ( isset($_REQUEST['apage']) )
</span><span class="lines">@@ -86,7 +90,7 @@
</span><span class="cx"> $mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']);
</span><span class="cx"> 
</span><span class="cx"> $comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all';
</span><del>-if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'deleted')) )
</del><ins>+if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) )
</ins><span class="cx">         $comment_status = 'all';
</span><span class="cx"> 
</span><span class="cx"> $comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
</span><span class="lines">@@ -102,13 +106,14 @@
</span><span class="cx"> &lt;/h2&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><del>-if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['destroyed'] ) || isset( $_GET['spam'] ) ) {
-        $approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
-        $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
-        $destroyed = isset( $_GET['destroyed'] ) ? (int) $_GET['destroyed'] : 0;
-        $spam = isset( $_GET['spam'] ) ? (int) $_GET['spam'] : 0;
</del><ins>+if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spam']) ) {
+        $approved = isset($_GET['approved']) ? (int) $_GET['approved'] : 0;
+        $deleted = isset($_GET['deleted']) ? (int) $_GET['deleted'] : 0;
+        $trashed = isset($_GET['trashed']) ? (int) $_GET['trashed'] : 0;
+        $untrashed = isset($_GET['untrashed']) ? (int) $_GET['untrashed'] : 0;
+        $spam = isset($_GET['spam']) ? (int) $_GET['spam'] : 0;
</ins><span class="cx"> 
</span><del>-        if ( $approved &gt; 0 || $deleted &gt; 0 || $destroyed &gt; 0 || $spam &gt; 0 ) {
</del><ins>+        if ( $approved &gt; 0 || $deleted &gt; 0 || $trashed &gt; 0 || $untrashed &gt; 0 || $spam &gt; 0 ) {
</ins><span class="cx">                 echo '&lt;div id=&quot;moderated&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;';
</span><span class="cx"> 
</span><span class="cx">                 if ( $approved &gt; 0 ) {
</span><span class="lines">@@ -119,14 +124,18 @@
</span><span class="cx">                         printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
</span><span class="cx">                         echo '&lt;br /&gt;';
</span><span class="cx">                 }
</span><del>-                if ( $deleted &gt; 0 ) {
-                        printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
</del><ins>+                if ( $trashed &gt; 0 ) {
+                        printf( _n( '%s comment moved to the trash', '%s comments moved to the trash', $trashed ), $trashed );
</ins><span class="cx">                         echo '&lt;br /&gt;';
</span><span class="cx">                 }
</span><del>-                if ( $destroyed &gt; 0 ) {
-                        printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $destroyed ), $destroyed );
</del><ins>+                if ( $untrashed &gt; 0 ) {
+                        printf( _n( '%s comment removed from the trash', '%s comments removed from the trash', $untrashed ), $untrashed );
</ins><span class="cx">                         echo '&lt;br /&gt;';
</span><span class="cx">                 }
</span><ins>+                if ( $deleted &gt; 0 ) {
+                        printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
+                        echo '&lt;br /&gt;';
+                }
</ins><span class="cx"> 
</span><span class="cx">                 echo '&lt;/p&gt;&lt;/div&gt;';
</span><span class="cx">         }
</span><span class="lines">@@ -145,7 +154,7 @@
</span><span class="cx">                 'moderated' =&gt; _n_noop('Pending &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;pending-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;', 'Pending &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;pending-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;'),
</span><span class="cx">                 'approved' =&gt; _n_noop('Approved', 'Approved'), // singular not used
</span><span class="cx">                 'spam' =&gt; _n_noop('Spam &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;spam-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;', 'Spam &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;spam-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;'),
</span><del>-                'deleted' =&gt; _n_noop('Trash &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;deleted-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;', 'Trash &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;deleted-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;')
</del><ins>+                'trash' =&gt; _n_noop('Trash &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;trash-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;', 'Trash &lt;span class=&quot;count&quot;&gt;(&lt;span class=&quot;trash-count&quot;&gt;%s&lt;/span&gt;)&lt;/span&gt;')
</ins><span class="cx">         );
</span><span class="cx"> $link = 'edit-comments.php';
</span><span class="cx"> if ( !empty($comment_type) &amp;&amp; 'all' != $comment_type )
</span><span class="lines">@@ -256,13 +265,13 @@
</span><span class="cx"> &lt;?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?&gt;
</span><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><del>-&lt;?php if ( 'deleted' == $comment_status ): ?&gt;
-&lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Return to Pending'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;?php if ( 'trash' == $comment_status ): ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
</ins><span class="cx"> &lt;?php endif; ?&gt;
</span><del>-&lt;?php if ( 'deleted' == $comment_status || 'spam' == $comment_status ): ?&gt;
-&lt;option value=&quot;destroy&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;?php if ( 'trash' == $comment_status || 'spam' == $comment_status ): ?&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
</ins><span class="cx"> &lt;?php else: ?&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;trash&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">@@ -289,12 +298,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) &amp;&amp; current_user_can ('moderate_comments') ) {
</del><ins>+if ( ( 'spam' == $comment_status || 'trash' == $comment_status) &amp;&amp; current_user_can ('moderate_comments') ) {
</ins><span class="cx">         wp_nonce_field('bulk-destroy', '_destroy_nonce');
</span><span class="cx">     if ( 'spam' == $comment_status ) { ?&gt;
</span><del>-                &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;
-&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;
</del><ins>+                &lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&quot; value=&quot;&lt;?php esc_attr_e('Empty Spam'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } elseif ( 'trash' == $comment_status ) { ?&gt;
+                &lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&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 }
</span><span class="cx"> } ?&gt;
</span><span class="cx"> &lt;?php do_action('manage_comments_nav', $comment_status); ?&gt;
</span><span class="lines">@@ -352,21 +361,21 @@
</span><span class="cx"> &lt;?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?&gt;
</span><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><del>-&lt;?php if ( 'deleted' == $comment_status ): ?&gt;
-&lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Return to Pending'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;?php if ( 'trash' == $comment_status ): ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
</ins><span class="cx"> &lt;?php endif; ?&gt;
</span><del>-&lt;?php if ( 'deleted' == $comment_status || 'spam' == $comment_status ): ?&gt;
-&lt;option value=&quot;destroy&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;?php if ( 'trash' == $comment_status || 'spam' == $comment_status ): ?&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
</ins><span class="cx"> &lt;?php else: ?&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;trash&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><span class="cx"> &lt;?php if ( 'spam' == $comment_status ) { ?&gt;
</span><del>-&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;
</del><ins>+&lt;input type=&quot;submit&quot; name=&quot;delete_all2&quot; id=&quot;delete_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Spam'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } elseif ( 'trash' == $comment_status ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;delete_all2&quot; id=&quot;delete_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="trunkwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-advanced.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-advanced.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/edit-form-advanced.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx"> &lt;div id=&quot;delete-action&quot;&gt;
</span><span class="cx"> &lt;?php
</span><span class="cx"> if ( ( 'edit' == $action ) &amp;&amp; current_user_can('delete_post', $post-&gt;ID) ) { ?&gt;
</span><del>-&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID); ?&gt;&quot; onclick=&quot;if ( confirm('&lt;?php echo esc_js(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )); ?&gt;') ) {return true;}return false;&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/a&gt;
</del><ins>+&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;post.php?action=trash&amp;amp;post=$post-&gt;ID&quot;, 'trash-post_' . $post-&gt;ID); ?&gt;&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/a&gt;
</ins><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmineditformcommentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-comment.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-comment.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/edit-form-comment.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;major-publishing-actions&quot;&gt;
</span><span class="cx"> &lt;div id=&quot;delete-action&quot;&gt;
</span><del>-&lt;?php echo &quot;&lt;a class='submitdelete deletion' href='&quot; . wp_nonce_url(&quot;comment.php?action=deletecomment&amp;amp;c=$comment-&gt;comment_ID&amp;amp;_wp_original_http_referer=&quot; . urlencode(wp_get_referer()), 'delete-comment_' . $comment-&gt;comment_ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . esc_js(__(&quot;You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.&quot;)) . &quot;') ){return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;\n&quot;; ?&gt;
</del><ins>+&lt;?php echo &quot;&lt;a class='submitdelete deletion' href='&quot; . wp_nonce_url(&quot;comment.php?action=deletecomment&amp;amp;c=$comment-&gt;comment_ID&amp;amp;_wp_original_http_referer=&quot; . urlencode(wp_get_referer()), 'delete-comment_' . $comment-&gt;comment_ID) . &quot;'&gt;&quot; . __('Move to Trash') . &quot;&lt;/a&gt;\n&quot;; ?&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;publishing-action&quot;&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php esc_attr_e('Update Comment'); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button-primary&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadmineditpageformphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-page-form.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-page-form.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/edit-page-form.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx"> &lt;div id=&quot;delete-action&quot;&gt;
</span><span class="cx"> &lt;?php
</span><span class="cx"> if ( ( 'edit' == $action ) &amp;&amp; current_user_can('delete_page', $post-&gt;ID) ) { ?&gt;
</span><del>-&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;page.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-page_' . $post-&gt;ID); ?&gt;&quot; onclick=&quot;if ( confirm('&lt;?php echo esc_js(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )); ?&gt;') ) {return true;}return false;&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/a&gt;
</del><ins>+&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;page.php?action=trash&amp;amp;post=$post-&gt;ID&quot;, 'trash-page_' . $post-&gt;ID); ?&gt;&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/a&gt;
</ins><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmineditpagesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-pages.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-pages.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/edit-pages.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -10,45 +10,71 @@
</span><span class="cx"> require_once('admin.php');
</span><span class="cx"> 
</span><span class="cx"> // Handle bulk actions
</span><del>-if ( isset($_GET['action']) &amp;&amp; ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
-        $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
</del><ins>+if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+        check_admin_referer('bulk-pages');
+        
+        if (isset($_GET['delete_all']) || isset($_GET['delete_all2'])) {
+                $post_status = $wpdb-&gt;escape($_GET['post_status']);
+                $post_ids = $wpdb-&gt;get_col( &quot;SELECT ID FROM $wpdb-&gt;posts WHERE post_type='page' AND post_status = '$post_status'&quot; );
+                $doaction = 'delete';
+        } elseif (($_GET['action'] != -1 || $_GET['action2'] != -1) &amp;&amp; isset($_GET['post'])) {
+                $post_ids = $_GET['post'];
+                $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
+        } else wp_redirect($_SERVER['HTTP_REFERER']);
</ins><span class="cx"> 
</span><span class="cx">         switch ( $doaction ) {
</span><del>-                case 'delete':
-                        if ( isset($_GET['post']) &amp;&amp; ! isset($_GET['bulk_edit']) &amp;&amp; (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
-                                check_admin_referer('bulk-pages');
-                                $deleted = 0;
-                                foreach( (array) $_GET['post'] as $post_id_del ) {
-                                        $post_del = &amp; get_post($post_id_del);
</del><ins>+                case 'trash':
+                        $trashed = 0;
+                        foreach( (array) $post_ids as $post_id ) {
+                                if ( !current_user_can('delete_page', $post_id) )
+                                        wp_die( __('You are not allowed to move this page to the trash.') );
</ins><span class="cx"> 
</span><del>-                                        if ( !current_user_can('delete_page', $post_id_del) )
-                                                wp_die( __('You are not allowed to delete this page.') );
</del><ins>+                                if ( !wp_trash_post($post_id) )
+                                        wp_die( __('Error in moving to trash...') );
+                                
+                                $trashed++;
+                        }
+                        break;
+                case 'untrash':
+                        $untrashed = 0;
+                        foreach( (array) $post_ids as $post_id ) {
+                                if ( !current_user_can('delete_page', $post_id) )
+                                        wp_die( __('You are not allowed to remove this page from the trash.') );
</ins><span class="cx"> 
</span><del>-                                        if ( $post_del-&gt;post_type == 'attachment' ) {
-                                                if ( ! wp_delete_attachment($post_id_del) )
-                                                        wp_die( __('Error in deleting...') );
-                                        } else {
-                                                if ( !wp_delete_post($post_id_del) )
-                                                        wp_die( __('Error in deleting...') );
-                                        }
-                                        $deleted++;
-                                }
</del><ins>+                                if ( !wp_untrash_post($post_id) )
+                                        wp_die( __('Error in removing from trash...') );
+                                
+                                $untrashed++;
</ins><span class="cx">                         }
</span><span class="cx">                         break;
</span><del>-                case 'edit':
-                        if ( isset($_GET['post']) &amp;&amp; isset($_GET['bulk_edit']) ) {
-                                check_admin_referer('bulk-pages');
</del><ins>+                case 'delete':
+                        $deleted = 0;
+                        foreach( (array) $post_ids as $post_id_del ) {
+                                $post_del = &amp; get_post($post_id_del);
</ins><span class="cx"> 
</span><del>-                                if ( -1 == $_GET['_status'] ) {
-                                        $_GET['post_status'] = null;
-                                        unset($_GET['_status'], $_GET['post_status']);
</del><ins>+                                if ( !current_user_can('delete_page', $post_id_del) )
+                                        wp_die( __('You are not allowed to delete this page.') );
+
+                                if ( $post_del-&gt;post_type == 'attachment' ) {
+                                        if ( ! wp_delete_attachment($post_id_del) )
+                                                wp_die( __('Error in deleting...') );
</ins><span class="cx">                                 } else {
</span><del>-                                        $_GET['post_status'] = $_GET['_status'];
</del><ins>+                                        if ( !wp_delete_post($post_id_del) )
+                                                wp_die( __('Error in deleting...') );
</ins><span class="cx">                                 }
</span><del>-
-                                $done = bulk_edit_posts($_GET);
</del><ins>+                                $deleted++;
</ins><span class="cx">                         }
</span><span class="cx">                         break;
</span><ins>+                case 'edit':
+                        if ( -1 == $_GET['_status'] ) {
+                                $_GET['post_status'] = null;
+                                unset($_GET['_status'], $_GET['post_status']);
+                        } else {
+                                $_GET['post_status'] = $_GET['_status'];
+                        }
+
+                        $done = bulk_edit_posts($_GET);
+                        break;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $sendback = wp_get_referer();
</span><span class="lines">@@ -62,6 +88,10 @@
</span><span class="cx">         }
</span><span class="cx">         if ( isset($deleted) )
</span><span class="cx">                 $sendback = add_query_arg('deleted', $deleted, $sendback);
</span><ins>+        elseif ( isset($trashed) )
+                $sendback = add_query_arg('trashed', $trashed, $sendback);
+        elseif ( isset($untrashed) )
+                $sendback = add_query_arg('untrashed', $untrashed, $sendback);
</ins><span class="cx">         wp_redirect($sendback);
</span><span class="cx">         exit();
</span><span class="cx"> } elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
</span><span class="lines">@@ -79,7 +109,8 @@
</span><span class="cx">                 'future' =&gt; array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
</span><span class="cx">                 'pending' =&gt; array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
</span><span class="cx">                 'draft' =&gt; array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Drafts &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
</span><del>-                'private' =&gt; array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page'))
</del><ins>+                'private' =&gt; array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
+                'trash' =&gt; array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page'))
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx"> $post_stati = apply_filters('page_stati', $post_stati);
</span><span class="lines">@@ -111,28 +142,33 @@
</span><span class="cx">         printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __('Search results for &amp;#8220;%s&amp;#8221;') . '&lt;/span&gt;', esc_html( get_search_query() ) ); ?&gt;
</span><span class="cx"> &lt;/h2&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?&gt;
</del><ins>+&lt;?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?&gt;
</ins><span class="cx"> &lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;
</span><span class="cx"> &lt;?php if ( isset($_GET['updated']) &amp;&amp; (int) $_GET['updated'] ) {
</span><span class="cx">         printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
</span><span class="cx">         unset($_GET['updated']);
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> if ( isset($_GET['skipped']) &amp;&amp; (int) $_GET['skipped'] ) {
</span><span class="cx">         printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
</span><span class="cx">         unset($_GET['skipped']);
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> if ( isset($_GET['locked']) &amp;&amp; (int) $_GET['locked'] ) {
</span><span class="cx">         printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
</span><span class="cx">         unset($_GET['locked']);
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> if ( isset($_GET['deleted']) &amp;&amp; (int) $_GET['deleted'] ) {
</span><del>-        printf( _n( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
</del><ins>+        printf( _n( 'Page permanently deleted.', '%s pages permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
</ins><span class="cx">         unset($_GET['deleted']);
</span><span class="cx"> }
</span><del>-$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
</del><ins>+if ( isset($_GET['trashed']) &amp;&amp; (int) $_GET['trashed'] ) {
+        printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
+        unset($_GET['trashed']);
+}
+if ( isset($_GET['untrashed']) &amp;&amp; (int) $_GET['untrashed'] ) {
+        printf( _n( 'Page removed from the trash.', '%s pages removed from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
+        unset($_GET['untrashed']);
+}
+$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;/p&gt;&lt;/div&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="lines">@@ -150,7 +186,7 @@
</span><span class="cx"> if ( empty($locked_post_status) ) :
</span><span class="cx"> $status_links = array();
</span><span class="cx"> $num_posts = wp_count_posts('page', 'readable');
</span><del>-$total_posts = array_sum( (array) $num_posts );
</del><ins>+$total_posts = array_sum( (array) $num_posts ) - $num_posts-&gt;trash;
</ins><span class="cx"> $class = empty($_GET['post_status']) ? ' class=&quot;current&quot;' : '';
</span><span class="cx"> $status_links[] = &quot;&lt;li&gt;&lt;a href='edit-pages.php'$class&gt;&quot; . sprintf( _nx( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . '&lt;/a&gt;';
</span><span class="cx"> foreach ( $post_stati as $status =&gt; $label ) {
</span><span class="lines">@@ -212,11 +248,19 @@
</span><span class="cx"> &lt;div class=&quot;alignleft actions&quot;&gt;
</span><span class="cx"> &lt;select name=&quot;action&quot;&gt;
</span><span class="cx"> &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
</span><ins>+&lt;?php if ($_GET['post_status'] == 'trash') { ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
+&lt;?php } else { ?&gt;
</ins><span class="cx"> &lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
</span><span class="cx"> &lt;?php wp_nonce_field('bulk-pages'); ?&gt;
</span><ins>+&lt;?php if ($_GET['post_status'] == 'trash') { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span><span class="lines">@@ -251,10 +295,18 @@
</span><span class="cx"> &lt;div class=&quot;alignleft actions&quot;&gt;
</span><span class="cx"> &lt;select name=&quot;action2&quot;&gt;
</span><span class="cx"> &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
</span><ins>+&lt;?php if ($_GET['post_status'] == 'trash') { ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
+&lt;?php } else { ?&gt;
</ins><span class="cx"> &lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
</span><ins>+&lt;?php if ($_GET['post_status'] == 'trash') { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;delete_all2&quot; id=&quot;delete_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadmineditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/edit.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -18,45 +18,75 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Handle bulk actions
</span><del>-if ( isset($_GET['action']) &amp;&amp; ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
-        $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
-
</del><ins>+if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+        check_admin_referer('bulk-posts');
+        
+        if (isset($_GET['delete_all']) || isset($_GET['delete_all2'])) {
+                $post_status = $wpdb-&gt;escape($_GET['post_status']);
+                $post_ids = $wpdb-&gt;get_col( &quot;SELECT ID FROM $wpdb-&gt;posts WHERE post_type='post' AND post_status = '$post_status'&quot; );
+                $doaction = 'delete';
+        } elseif (($_GET['action'] != -1 || $_GET['action2'] != -1) &amp;&amp; isset($_GET['post'])) {
+                $post_ids = $_GET['post'];
+                $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
+        } else wp_redirect($_SERVER['HTTP_REFERER']);
+        
</ins><span class="cx">         switch ( $doaction ) {
</span><del>-                case 'delete':
-                        if ( isset($_GET['post']) &amp;&amp; ! isset($_GET['bulk_edit']) &amp;&amp; (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
-                                check_admin_referer('bulk-posts');
-                                $deleted = 0;
-                                foreach( (array) $_GET['post'] as $post_id_del ) {
-                                        $post_del = &amp; get_post($post_id_del);
</del><ins>+                case 'trash':
+                        $trashed = 0;
+                        foreach( (array) $post_ids as $post_id ) {
+                                $post_del = &amp; get_post($post_id);
</ins><span class="cx"> 
</span><del>-                                        if ( !current_user_can('delete_post', $post_id_del) )
-                                                wp_die( __('You are not allowed to delete this post.') );
</del><ins>+                                if ( !current_user_can('delete_post', $post_id_del) )
+                                        wp_die( __('You are not allowed to move this post to the trash.') );
</ins><span class="cx"> 
</span><del>-                                        if ( $post_del-&gt;post_type == 'attachment' ) {
-                                                if ( ! wp_delete_attachment($post_id_del) )
-                                                        wp_die( __('Error in deleting...') );
-                                        } else {
-                                                if ( !wp_delete_post($post_id_del) )
-                                                        wp_die( __('Error in deleting...') );
-                                        }
-                                        $deleted++;
-                                }
</del><ins>+                                if ( !wp_trash_post($post_id) )
+                                        wp_die( __('Error in moving to trash...') );
+                                
+                                $trashed++;
</ins><span class="cx">                         }
</span><span class="cx">                         break;
</span><del>-                case 'edit':
-                        if ( isset($_GET['post']) &amp;&amp; isset($_GET['bulk_edit']) ) {
-                                check_admin_referer('bulk-posts');
</del><ins>+                case 'untrash':
+                        $untrashed = 0;
+                        foreach( (array) $post_ids as $post_id ) {
+                                $post_del = &amp; get_post($post_id);
</ins><span class="cx"> 
</span><del>-                                if ( -1 == $_GET['_status'] ) {
-                                        $_GET['post_status'] = null;
-                                        unset($_GET['_status'], $_GET['post_status']);
</del><ins>+                                if ( !current_user_can('delete_post', $post_id_del) )
+                                        wp_die( __('You are not allowed to remove this post from the trash.') );
+
+                                if ( !wp_untrash_post($post_id) )
+                                        wp_die( __('Error in removing from trash...') );
+                                
+                                $untrashed++;
+                        }
+                        break;
+                case 'delete':
+                        $deleted = 0;
+                        foreach( (array) $post_ids as $post_id_del ) {
+                                $post_del = &amp; get_post($post_id_del);
+
+                                if ( !current_user_can('delete_post', $post_id_del) )
+                                        wp_die( __('You are not allowed to delete this post.') );
+
+                                if ( $post_del-&gt;post_type == 'attachment' ) {
+                                        if ( ! wp_delete_attachment($post_id_del) )
+                                                wp_die( __('Error in deleting...') );
</ins><span class="cx">                                 } else {
</span><del>-                                        $_GET['post_status'] = $_GET['_status'];
</del><ins>+                                        if ( !wp_delete_post($post_id_del) )
+                                                wp_die( __('Error in deleting...') );
</ins><span class="cx">                                 }
</span><del>-
-                                $done = bulk_edit_posts($_GET);
</del><ins>+                                $deleted++;
</ins><span class="cx">                         }
</span><span class="cx">                         break;
</span><ins>+                case 'edit':
+                        if ( -1 == $_GET['_status'] ) {
+                                $_GET['post_status'] = null;
+                                unset($_GET['_status'], $_GET['post_status']);
+                        } else {
+                                $_GET['post_status'] = $_GET['_status'];
+                        }
+
+                        $done = bulk_edit_posts($_GET);
+                        break;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $sendback = wp_get_referer();
</span><span class="lines">@@ -70,6 +100,10 @@
</span><span class="cx">         }
</span><span class="cx">         if ( isset($deleted) )
</span><span class="cx">                 $sendback = add_query_arg('deleted', $deleted, $sendback);
</span><ins>+        elseif ( isset($trashed) )
+                $sendback = add_query_arg('trashed', $trashed, $sendback);
+        elseif ( isset($untrashed) )
+                $sendback = add_query_arg('untrashed', $untrashed, $sendback);
</ins><span class="cx">         wp_redirect($sendback);
</span><span class="cx">         exit();
</span><span class="cx"> } elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
</span><span class="lines">@@ -107,7 +141,7 @@
</span><span class="cx"> &lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
</span><span class="cx"> endif; ?&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?&gt;
</del><ins>+&lt;?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?&gt;
</ins><span class="cx"> &lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;
</span><span class="cx"> &lt;?php if ( isset($_GET['updated']) &amp;&amp; (int) $_GET['updated'] ) {
</span><span class="cx">         printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
</span><span class="lines">@@ -123,10 +157,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if ( isset($_GET['deleted']) &amp;&amp; (int) $_GET['deleted'] ) {
</span><del>-        printf( _n( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
</del><ins>+        printf( _n( 'Post permanently deleted.', '%s posts permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
</ins><span class="cx">         unset($_GET['deleted']);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+if ( isset($_GET['trashed']) &amp;&amp; (int) $_GET['trashed'] ) {
+        printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
+        unset($_GET['deleted']);
+}
+
+if ( isset($_GET['untrashed']) &amp;&amp; (int) $_GET['untrashed'] ) {
+        printf( _n( 'Post removed from the trash.', '%s posts removed from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
+        unset($_GET['undeleted']);
+}
+
</ins><span class="cx"> $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;/p&gt;&lt;/div&gt;
</span><span class="lines">@@ -139,7 +183,7 @@
</span><span class="cx"> if ( empty($locked_post_status) ) :
</span><span class="cx"> $status_links = array();
</span><span class="cx"> $num_posts = wp_count_posts( 'post', 'readable' );
</span><del>-$total_posts = array_sum( (array) $num_posts );
</del><ins>+$total_posts = array_sum( (array) $num_posts ) - $num_posts-&gt;trash;
</ins><span class="cx"> $class = empty( $_GET['post_status'] ) ? ' class=&quot;current&quot;' : '';
</span><span class="cx"> $status_links[] = &quot;&lt;li&gt;&lt;a href='edit.php' $class&gt;&quot; . sprintf( _nx( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '&lt;/a&gt;';
</span><span class="cx"> 
</span><span class="lines">@@ -190,8 +234,13 @@
</span><span class="cx"> &lt;div class=&quot;alignleft actions&quot;&gt;
</span><span class="cx"> &lt;select name=&quot;action&quot;&gt;
</span><span class="cx"> &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
</span><ins>+&lt;?php if ($_GET['post_status'] == 'trash') { ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
+&lt;?php } else { ?&gt;
</ins><span class="cx"> &lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
</span><span class="cx"> &lt;?php wp_nonce_field('bulk-posts'); ?&gt;
</span><span class="lines">@@ -235,7 +284,8 @@
</span><span class="cx"> do_action('restrict_manage_posts');
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e('Filter'); ?&gt;&quot; class=&quot;button-secondary&quot; /&gt;
</span><del>-
</del><ins>+&lt;?php } if ( $_GET['post_status'] == 'trash' ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&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;/div&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -270,10 +320,18 @@
</span><span class="cx"> &lt;div class=&quot;alignleft actions&quot;&gt;
</span><span class="cx"> &lt;select name=&quot;action2&quot;&gt;
</span><span class="cx"> &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
</span><ins>+&lt;?php if ( $_GET['post_status'] == 'trash' ) { ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
+&lt;?php } else { ?&gt;
</ins><span class="cx"> &lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
</del><ins>+&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
</span><ins>+&lt;?php if ( $_GET['post_status'] == 'trash' ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;delete_all2&quot; id=&quot;delete_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadminincludesdashboardphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/dashboard.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/dashboard.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/includes/dashboard.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx">         $comments = array();
</span><span class="cx">         $start = 0;
</span><span class="cx"> 
</span><del>-        while ( count( $comments ) &lt; 5 &amp;&amp; $possible = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;comments ORDER BY comment_date_gmt DESC LIMIT $start, 50&quot; ) ) {
</del><ins>+        while ( count( $comments ) &lt; 5 &amp;&amp; $possible = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;comments c LEFT JOIN $wpdb-&gt;posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50&quot; ) ) {
</ins><span class="cx"> 
</span><span class="cx">                 foreach ( $possible as $comment ) {
</span><span class="cx">                         if ( count( $comments ) &gt;= 5 )
</span></span></pre></div>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/includes/media.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -1166,15 +1166,13 @@
</span><span class="cx">                 'extra_rows' =&gt; array(),
</span><span class="cx">         );
</span><span class="cx"> 
</span><del>-        $delete_href = wp_nonce_url(&quot;post.php?action=delete-post&amp;amp;post=$attachment_id&quot;, 'delete-post_' . $attachment_id);
</del><ins>+        $delete_href = wp_nonce_url(&quot;post.php?action=trash&amp;amp;post=$attachment_id&quot;, 'delete-post_' . $attachment_id);
</ins><span class="cx">         if ( $send )
</span><span class="cx">                 $send = &quot;&lt;input type='submit' class='button' name='send[$attachment_id]' value='&quot; . esc_attr__( 'Insert into Post' ) . &quot;' /&gt;&quot;;
</span><span class="cx">         if ( $delete )
</span><del>-                $delete = &quot;&lt;a href=\&quot;#\&quot; class=\&quot;del-link\&quot; onclick=\&quot;document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
</del><ins>+                $delete = &quot;&lt;a href=\&quot;$delete_href\&quot; id=\&quot;del[$attachment_id]\&quot; class=\&quot;delete\&quot;&gt;&quot; . __('Move to Trash') . &quot;&lt;/a&gt;&quot;;
</ins><span class="cx">         if ( ( $send || $delete ) &amp;&amp; !isset($form_fields['buttons']) )
</span><del>-                $form_fields['buttons'] = array('tr' =&gt; &quot;\t\t&lt;tr class='submit'&gt;&lt;td&gt;&lt;/td&gt;&lt;td class='savesend'&gt;$send $delete
-                &lt;div id=\&quot;del_attachment_$attachment_id\&quot; class=\&quot;del-attachment\&quot; style=\&quot;display:none;\&quot;&gt;&quot; . sprintf(__(&quot;You are about to delete &lt;strong&gt;%s&lt;/strong&gt;.&quot;), $filename) . &quot; &lt;a href=\&quot;$delete_href\&quot; id=\&quot;del[$attachment_id]\&quot; class=\&quot;delete\&quot;&gt;&quot; . __('Continue') . &quot;&lt;/a&gt;
-                &lt;a href=\&quot;#\&quot; class=\&quot;del-link\&quot; onclick=\&quot;this.parentNode.style.display='none';return false;\&quot;&gt;&quot; . __('Cancel') . &quot;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;\n&quot;);
</del><ins>+                $form_fields['buttons'] = array('tr' =&gt; &quot;\t\t&lt;tr class='submit'&gt;&lt;td&gt;&lt;/td&gt;&lt;td class='savesend'&gt;$send $delete&lt;/td&gt;&lt;/tr&gt;\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">         $hidden_fields = array();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/includes/post.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -795,6 +795,7 @@
</span><span class="cx">                                 'pending' =&gt; array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
</span><span class="cx">                                 'draft' =&gt; array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Drafts &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
</span><span class="cx">                                 'private' =&gt; array(_x('Private', 'post'), __('Private posts'), _n_noop('Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
</span><ins>+                                'trash' =&gt; array(_x('Trash', 'post'), __('Trash posts'), _n_noop('Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
</ins><span class="cx">                         );
</span><span class="cx"> 
</span><span class="cx">         $post_stati = apply_filters('post_stati', $post_stati);
</span><span class="lines">@@ -858,7 +859,7 @@
</span><span class="cx">         $q['m']   = isset( $q['m'] ) ? (int) $q['m'] : 0;
</span><span class="cx">         $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
</span><span class="cx">         $q['post_type'] = 'attachment';
</span><del>-        $q['post_status'] = 'any';
</del><ins>+        $q['post_status'] = isset( $q['status'] ) &amp;&amp; 'trash' == $q['status'] ? 'trash' : 'any';
</ins><span class="cx">         $media_per_page = get_user_option('upload_per_page');
</span><span class="cx">         if ( empty($media_per_page) )
</span><span class="cx">                 $media_per_page = 20;
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/includes/template.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -1433,24 +1433,29 @@
</span><span class="cx">                 case 'title':
</span><span class="cx">                         $attributes = 'class=&quot;post-title column-title&quot;' . $style;
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can( 'edit_post', $post-&gt;ID ) ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $title; }; _post_states($post); ?&gt;&lt;/strong&gt;
</del><ins>+                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can('edit_post', $post-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $title; }; _post_states($post); ?&gt;&lt;/strong&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                         if ( 'excerpt' == $mode )
</span><span class="cx">                                 the_excerpt();
</span><span class="cx"> 
</span><span class="cx">                         $actions = array();
</span><del>-                        if ( current_user_can('edit_post', $post-&gt;ID) ) {
-                                $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot; title=&quot;' . esc_attr(__('Edit this post')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
-                                $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot; title=&quot;' . esc_attr(__('Edit this post inline')) . '&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
-                        }
-                        if ( current_user_can('delete_post', $post-&gt;ID) ) {
-                                $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Delete this post')) . &quot;' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . esc_js(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
-                        }
-                        if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
-                                if ( current_user_can('edit_post', $post-&gt;ID) )
-                                        $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
</del><ins>+                        if ( 'trash' == $post-&gt;post_status &amp;&amp; current_user_can('delete_post', $post-&gt;ID) ) {
+                                $actions['untrash'] = &quot;&lt;a title='&quot; . esc_attr(__('Remove this post from the Trash')) . &quot;' href='&quot; . wp_nonce_url(&quot;post.php?action=untrash&amp;amp;post=$post-&gt;ID&quot;, 'untrash-post_' . $post-&gt;ID) . &quot;'&gt;&quot; . __('Restore') . &quot;&lt;/a&gt;&quot;;
+                                $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Delete this post permanently')) . &quot;' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID) . &quot;'&gt;&quot; . __('Delete Permanently') . &quot;&lt;/a&gt;&quot;;
</ins><span class="cx">                         } else {
</span><del>-                                $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
</del><ins>+                                if ( current_user_can('edit_post', $post-&gt;ID) ) {
+                                        $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot; title=&quot;' . esc_attr(__('Edit this post')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+                                        $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot; title=&quot;' . esc_attr(__('Edit this post inline')) . '&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+                                }
+                                if ( current_user_can('delete_post', $post-&gt;ID) ) {
+                                        $actions['trash'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Move this post to the Trash')) . &quot;' href='&quot; . wp_nonce_url(&quot;post.php?action=trash&amp;amp;post=$post-&gt;ID&quot;, 'trash-post_' . $post-&gt;ID) . &quot;'&gt;&quot; . __('Trash') . &quot;&lt;/a&gt;&quot;;
+                                }
+                                if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
+                                        if ( current_user_can('edit_post', $post-&gt;ID) )
+                                                $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
+                                } else {
+                                        $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                         $actions = apply_filters('post_row_actions', $actions, $post);
</span><span class="cx">                         $action_count = count($actions);
</span><span class="lines">@@ -1651,21 +1656,26 @@
</span><span class="cx">                 $attributes = 'class=&quot;post-title page-title column-title&quot;' . $style;
</span><span class="cx">                 $edit_link = get_edit_post_link( $page-&gt;ID );
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can( 'edit_page', $page-&gt;ID ) ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?&gt;&lt;/strong&gt;
</del><ins>+                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can('edit_page', $page-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?&gt;&lt;/strong&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                 $actions = array();
</span><del>-                if ( current_user_can('edit_page', $page-&gt;ID) ) {
-                        $actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot; title=&quot;' . esc_attr(__('Edit this page')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
-                        $actions['inline'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
-                }
-                if ( current_user_can('delete_page', $page-&gt;ID) ) {
-                        $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Delete this page')) . &quot;' href='&quot; . wp_nonce_url(&quot;page.php?action=delete&amp;amp;post=$page-&gt;ID&quot;, 'delete-page_' . $page-&gt;ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . esc_js(sprintf( ('draft' == $page-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;), $page-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
-                }
-                if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
-                        if ( current_user_can('edit_page', $page-&gt;ID) )
-                                $actions['view'] = '&lt;a href=&quot;' . get_permalink($page-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
</del><ins>+                if ($post-&gt;post_status == 'trash' &amp;&amp; current_user_can('delete_page', $page-&gt;ID)) {
+                        $actions['untrash'] = &quot;&lt;a title='&quot; . esc_attr(__('Remove this page from the Trash')) . &quot;' href='&quot; . wp_nonce_url(&quot;page.php?action=untrash&amp;amp;post=$page-&gt;ID&quot;, 'untrash-page_' . $page-&gt;ID) . &quot;'&gt;&quot; . __('Restore') . &quot;&lt;/a&gt;&quot;;
+                        $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Delete this page permanently')) . &quot;' href='&quot; . wp_nonce_url(&quot;page.php?action=delete&amp;amp;post=$page-&gt;ID&quot;, 'delete-page_' . $page-&gt;ID) . &quot;'&gt;&quot; . __('Delete Permanently') . &quot;&lt;/a&gt;&quot;;
</ins><span class="cx">                 } else {
</span><del>-                        $actions['view'] = '&lt;a href=&quot;' . get_permalink($page-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
</del><ins>+                        if ( current_user_can('edit_page', $page-&gt;ID) ) {
+                                $actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot; title=&quot;' . esc_attr(__('Edit this page')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+                                $actions['inline'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+                        }
+                        if ( current_user_can('delete_page', $page-&gt;ID) ) {
+                                $actions['trash'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Move this page to the Trash')) . &quot;' href='&quot; . wp_nonce_url(&quot;page.php?action=trash&amp;amp;post=$page-&gt;ID&quot;, 'trash-page_' . $page-&gt;ID) . &quot;'&gt;&quot; . __('Trash') . &quot;&lt;/a&gt;&quot;;
+                        }
+                        if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
+                                if ( current_user_can('edit_page', $page-&gt;ID) )
+                                        $actions['view'] = '&lt;a href=&quot;' . get_permalink($page-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
+                        } else {
+                                $actions['view'] = '&lt;a href=&quot;' . get_permalink($page-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
+                        }
</ins><span class="cx">                 }
</span><span class="cx">                 $actions = apply_filters('page_row_actions', $actions, $page);
</span><span class="cx">                 $action_count = count($actions);
</span><span class="lines">@@ -1981,7 +1991,7 @@
</span><span class="cx">  *
</span><span class="cx">  * @since unknown
</span><span class="cx">  *
</span><del>- * @param string $status Comment status (approved, spam, deleted, etc)
</del><ins>+ * @param string $status Comment status (approved, spam, trash, etc)
</ins><span class="cx">  * @param string $s Term to search for
</span><span class="cx">  * @param int $start Offset to start at for pagination
</span><span class="cx">  * @param int $num Maximum number of comments to return
</span><span class="lines">@@ -1999,62 +2009,63 @@
</span><span class="cx">         $index = '';
</span><span class="cx"> 
</span><span class="cx">         if ( 'moderated' == $status ) {
</span><del>-                $approved = &quot;comment_approved = '0'&quot;;
</del><ins>+                $approved = &quot;c.comment_approved = '0'&quot;;
</ins><span class="cx">                 $total = $count-&gt;moderated;
</span><span class="cx">         } elseif ( 'approved' == $status ) {
</span><del>-                $approved = &quot;comment_approved = '1'&quot;;
</del><ins>+                $approved = &quot;c.comment_approved = '1'&quot;;
</ins><span class="cx">                 $total = $count-&gt;approved;
</span><span class="cx">         } elseif ( 'spam' == $status ) {
</span><del>-                $approved = &quot;comment_approved = 'spam'&quot;;
</del><ins>+                $approved = &quot;c.comment_approved = 'spam'&quot;;
</ins><span class="cx">                 $total = $count-&gt;spam;
</span><del>-        } elseif ( 'deleted' == $status ) {
-                $approved = &quot;comment_approved = 'deleted'&quot;;
-                $total = $count-&gt;deleted;
</del><ins>+        } elseif ( 'trash' == $status ) {
+                $approved = &quot;c.comment_approved = 'trash'&quot;;
+                $total = $count-&gt;trash;
</ins><span class="cx">         } else {
</span><del>-                $approved = &quot;( comment_approved = '0' OR comment_approved = '1' )&quot;;
</del><ins>+                $approved = &quot;( c.comment_approved = '0' OR c.comment_approved = '1' )&quot;;
</ins><span class="cx">                 $total = $count-&gt;moderated + $count-&gt;approved;
</span><del>-                $index = 'USE INDEX (comment_date_gmt)';
</del><ins>+                $index = 'USE INDEX (c.comment_date_gmt)';
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( $post ) {
</span><span class="cx">                 $total = '';
</span><del>-                $post = &quot; AND comment_post_ID = '$post'&quot;;
-                $orderby = &quot;ORDER BY comment_date_gmt ASC LIMIT $start, $num&quot;;
</del><ins>+                $post = &quot; AND c.comment_post_ID = '$post'&quot;;
+                $orderby = &quot;ORDER BY c.comment_date_gmt ASC LIMIT $start, $num&quot;;
</ins><span class="cx">         } else {
</span><span class="cx">                 $post = '';
</span><del>-                $orderby = &quot;ORDER BY comment_date_gmt DESC LIMIT $start, $num&quot;;
</del><ins>+                $orderby = &quot;ORDER BY c.comment_date_gmt DESC LIMIT $start, $num&quot;;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( 'comment' == $type )
</span><del>-                $typesql = &quot;AND comment_type = ''&quot;;
</del><ins>+                $typesql = &quot;AND c.comment_type = ''&quot;;
</ins><span class="cx">         elseif ( 'pings' == $type )
</span><del>-                $typesql = &quot;AND ( comment_type = 'pingback' OR comment_type = 'trackback' )&quot;;
</del><ins>+                $typesql = &quot;AND ( c.comment_type = 'pingback' OR c.comment_type = 'trackback' )&quot;;
</ins><span class="cx">         elseif ( !empty($type) )
</span><del>-                $typesql = $wpdb-&gt;prepare(&quot;AND comment_type = %s&quot;, $type);
</del><ins>+                $typesql = $wpdb-&gt;prepare(&quot;AND c.comment_type = %s&quot;, $type);
</ins><span class="cx">         else
</span><span class="cx">                 $typesql = '';
</span><span class="cx"> 
</span><span class="cx">         if ( !empty($type) )
</span><span class="cx">                 $total = '';
</span><span class="cx"> 
</span><ins>+        $query = &quot;FROM $wpdb-&gt;comments c LEFT JOIN $wpdb-&gt;posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' &quot;;
</ins><span class="cx">         if ( $s ) {
</span><span class="cx">                 $total = '';
</span><span class="cx">                 $s = $wpdb-&gt;escape($s);
</span><del>-                $query = &quot;FROM $wpdb-&gt;comments WHERE
-                        (comment_author LIKE '%$s%' OR
-                        comment_author_email LIKE '%$s%' OR
-                        comment_author_url LIKE ('%$s%') OR
-                        comment_author_IP LIKE ('%$s%') OR
-                        comment_content LIKE ('%$s%') ) AND
</del><ins>+                $query .= &quot;AND
+                        (c.comment_author LIKE '%$s%' OR
+                        c.comment_author_email LIKE '%$s%' OR
+                        c.comment_author_url LIKE ('%$s%') OR
+                        c.comment_author_IP LIKE ('%$s%') OR
+                        c.comment_content LIKE ('%$s%') ) AND
</ins><span class="cx">                         $approved
</span><span class="cx">                         $typesql&quot;;
</span><span class="cx">         } else {
</span><del>-                $query = &quot;FROM $wpdb-&gt;comments $index WHERE $approved $post $typesql&quot;;
</del><ins>+                $query .= &quot;AND $approved $post $typesql&quot;;
</ins><span class="cx">         }
</span><del>-
</del><ins>+        
</ins><span class="cx">         $comments = $wpdb-&gt;get_results(&quot;SELECT * $query $orderby&quot;);
</span><span class="cx">         if ( '' === $total )
</span><del>-                $total = $wpdb-&gt;get_var(&quot;SELECT COUNT(comment_ID) $query&quot;);
</del><ins>+                $total = $wpdb-&gt;get_var(&quot;SELECT COUNT(c.comment_ID) $query&quot;);
</ins><span class="cx"> 
</span><span class="cx">         update_comment_cache($comments);
</span><span class="cx"> 
</span><span class="lines">@@ -2095,6 +2106,8 @@
</span><span class="cx">         $approve_url = esc_url( wp_nonce_url( &quot;comment.php?action=approvecomment&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;approve-comment_$comment-&gt;comment_ID&quot; ) );
</span><span class="cx">         $unapprove_url = esc_url( wp_nonce_url( &quot;comment.php?action=unapprovecomment&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;unapprove-comment_$comment-&gt;comment_ID&quot; ) );
</span><span class="cx">         $spam_url = esc_url( wp_nonce_url( &quot;comment.php?action=deletecomment&amp;dt=spam&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;delete-comment_$comment-&gt;comment_ID&quot; ) );
</span><ins>+        $trash_url = esc_url( wp_nonce_url( &quot;comment.php?action=trashcomment&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;trash-comment_$comment-&gt;comment_ID&quot; ) );
+        $untrash_url = esc_url( wp_nonce_url( &quot;comment.php?action=untrashcomment&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;untrash-comment_$comment-&gt;comment_ID&quot; ) );
</ins><span class="cx"> 
</span><span class="cx">         echo &quot;&lt;tr id='comment-$comment-&gt;comment_ID' class='$the_comment_status'&gt;&quot;;
</span><span class="cx">         $columns = get_column_headers('edit-comments');
</span><span class="lines">@@ -2134,9 +2147,9 @@
</span><span class="cx">                                 $actions = array();
</span><span class="cx"> 
</span><span class="cx">                                 if ( $user_can ) {
</span><del>-                                        if ( 'deleted' == $the_comment_status ) {
-                                                $actions['unapprove'] = &quot;&lt;a href='$unapprove_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID:e7e7d3:action=dim-comment&amp;amp;new=unapproved vim-u vim-destructive' title='&quot; . __( 'Return this comment to Unapproved status' ) . &quot;'&gt;&quot; . __( 'Return to Pending' ) . '&lt;/a&gt;';
-                                                $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;';
</del><ins>+                                        if ( 'trash' == $the_comment_status ) {
+                                                $actions['untrash'] = &quot;&lt;a href='$untrash_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::untrash=1 vim-t vim-destructive''&gt;&quot; . __( 'Restore' ) . '&lt;/a&gt;';
+                                                $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 Permanently') . '&lt;/a&gt;';
</ins><span class="cx">                                         } else {
</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="lines">@@ -2152,10 +2165,10 @@
</span><span class="cx">                                                 }
</span><span class="cx"> 
</span><span class="cx">                                                 if ( 'spam' == $the_comment_status ) {
</span><del>-                                                        $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;';
</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; . __('Delete Permanently') . '&lt;/a&gt;';
</ins><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; . __('Move to Trash') . '&lt;/a&gt;';
</del><ins>+                                                        $actions['trash'] = &quot;&lt;a href='$trash_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::trash=1 delete vim-t vim-destructive'&gt;&quot; . __('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 class="lines">@@ -2176,6 +2189,15 @@
</span><span class="cx">                                                 // Reply and quickedit need a hide-if-no-js span when not added with ajax
</span><span class="cx">                                                 if ( ('reply' == $action || 'quickedit' == $action) &amp;&amp; ! $from_ajax )
</span><span class="cx">                                                         $action .= ' hide-if-no-js';
</span><ins>+                                                elseif ($action == 'untrash' &amp;&amp; $the_comment_status == 'trash') {
+                                                        $trash_meta = get_option('wp_trash_meta');
+                                                        if (is_array($trash_meta) &amp;&amp; isset($trash_meta['comments'][$comment_id]['status'])) {
+                                                                if ($trash_meta['comments'][$comment_id]['status'] == '1')
+                                                                        $action .= ' approve';
+                                                                else
+                                                                        $action .= ' unapprove';
+                                                        }
+                                                }
</ins><span class="cx"> 
</span><span class="cx">                                                 echo &quot;&lt;span class='$action'&gt;$sep$link&lt;/span&gt;&quot;;
</span><span class="cx">                                         }
</span></span></pre></div>
<a id="trunkwpadminjscommondevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/common.dev.js (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/common.dev.js        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/js/common.dev.js        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -154,16 +154,6 @@
</span><span class="cx">         $('div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error').addClass('below-h2');
</span><span class="cx">         $('div.updated, div.error').not('.below-h2').insertAfter('div.wrap h2:first');
</span><span class="cx"> 
</span><del>-        // show warnings
-        $('#doaction, #doaction2').click(function(){
-                if ( $('select[name=&quot;action&quot;]').val() == 'destroy' || $('select[name=&quot;action2&quot;]').val() == 'destroy' ) {
-                        return showNotice.warn();
-                }
-        });
-        $('#destroy_all, #destroy_all2').click(function(){
-                return showNotice.warn();
-        });
-
</del><span class="cx">         // screen settings tab
</span><span class="cx">         $('#show-settings-link').click(function () {
</span><span class="cx">                 if ( ! $('#screen-options-wrap').hasClass('screen-options-open') ) {
</span></span></pre></div>
<a id="trunkwpadminjscommonjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/common.js (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/common.js        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/js/common.js        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var showNotice,adminMenu,columns,validateForm;(function(a){adminMenu={init:function(){a(&quot;#adminmenu div.wp-menu-toggle&quot;).each(function(){if(a(this).siblings(&quot;.wp-submenu&quot;).length){a(this).click(function(){adminMenu.toggle(a(this).siblings(&quot;.wp-submenu&quot;))})}else{a(this).hide()}});this.favorites();a(&quot;a.separator&quot;).click(function(){if(a(&quot;body&quot;).hasClass(&quot;folded&quot;)){adminMenu.fold(1);deleteUserSetting(&quot;mfold&quot;)}else{adminMenu.fold();setUserSetting(&quot;mfold&quot;,&quot;f&quot;)}return false});if(a(&quot;body&quot;).hasClass(&quot;folded&quot;)){this.fold()}this.restoreMenuState()},restoreMenuState:function(){a(&quot;#adminmenu li.wp-has-submenu&quot;).each(function(c,d){var b=getUserSetting(&quot;m&quot;+c);if(a(d).hasClass(&quot;wp-has-current-submenu&quot;)){return true}if(&quot;o&quot;==b){a(d).addClass(&quot;wp-menu-open&quot;)}else{if(&quot;c&quot;==b){a(d).removeClass(&quot;wp-menu-open&quot;)}}})},toggle:function(b){b.slideToggle(150,function(){b.css(&quot;display&quot;,&quot;&quot;)}).parent().toggleClass(&quot;wp-menu-open&quot;);a(&quot;#adminmenu li.wp-has-submenu&quot;).each(function(d,f){var c=a(f).hasClass(&quot;wp-menu-open&quot;)?&quot;o&quot;:&quot;c&quot;;setUserSetting(&quot;m&quot;+d,c)});return false},fold:function(b){if(b){a(&quot;body&quot;).removeClass(&quot;folded&quot;);a(&quot;#adminmenu li.wp-has-submenu&quot;).unbind()}else{a(&quot;body&quot;).addClass(&quot;folded&quot;);a(&quot;#adminmenu li.wp-has-submenu&quot;).hoverIntent({over:function(j){var d,c,g,k,i;d=a(this).find(&quot;.wp-submenu&quot;);c=d.parent().offset().top+d.height()+1;g=a(&quot;#wpwrap&quot;).height();k=60+c-g;i=a(window).height()+a(&quot;body&quot;).scrollTop()-15;if(i&lt;(c-k)){k=c-i}if(k&gt;1){d.css({marginTop:&quot;-&quot;+k+&quot;px&quot;})}else{if(d.css(&quot;marginTop&quot;)){d.css({marginTop:&quot;&quot;})}}d.addClass(&quot;sub-open&quot;)},out:function(){a(this).find(&quot;.wp-submenu&quot;).removeClass(&quot;sub-open&quot;).css({marginTop:&quot;&quot;})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a(&quot;#favorite-inside&quot;).width(a(&quot;#favorite-actions&quot;).width()-4);a(&quot;#favorite-toggle, #favorite-inside&quot;).bind(&quot;mouseenter&quot;,function(){a(&quot;#favorite-inside&quot;).removeClass(&quot;slideUp&quot;).addClass(&quot;slideDown&quot;);setTimeout(function(){if(a(&quot;#favorite-inside&quot;).hasClass(&quot;slideDown&quot;)){a(&quot;#favorite-inside&quot;).slideDown(100);a(&quot;#favorite-first&quot;).addClass(&quot;slide-down&quot;)}},200)});a(&quot;#favorite-toggle, #favorite-inside&quot;).bind(&quot;mouseleave&quot;,function(){a(&quot;#favorite-inside&quot;).removeClass(&quot;slideDown&quot;).addClass(&quot;slideUp&quot;);setTimeout(function(){if(a(&quot;#favorite-inside&quot;).hasClass(&quot;slideUp&quot;)){a(&quot;#favorite-inside&quot;).slideUp(100,function(){a(&quot;#favorite-first&quot;).removeClass(&quot;slide-down&quot;)})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(&quot;.hide-column-tog&quot;).click(function(){var c=a(this).val(),b=a(this).attr(&quot;checked&quot;);if(b){a(&quot;.column-&quot;+c).show()}else{a(&quot;.column-&quot;+c).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(&quot;.manage-column&quot;).filter(&quot;:hidden&quot;).map(function(){return this.id}).get().join(&quot;,&quot;);a.post(ajaxurl,{action:&quot;hidden-columns&quot;,hidden:b,screenoptionnonce:a(&quot;#screenoptionnonce&quot;).val(),page:pagenow})}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(&quot;.form-required&quot;).filter(function(){return a(&quot;input:visible&quot;,this).val()==&quot;&quot;}).addClass(&quot;form-invalid&quot;).change(function(){a(this).removeClass(&quot;form-invalid&quot;)}).size()}})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||&quot;&quot;;if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d(&quot;.fade&quot;).animate({backgroundColor:&quot;#ffffe0&quot;},300).animate({backgroundColor:&quot;#fffbcc&quot;},300).animate({backgroundColor:&quot;#ffffe0&quot;},300).animate({backgroundColor:&quot;#fffbcc&quot;},300);d(&quot;div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error&quot;).addClass(&quot;below-h2&quot;);d(&quot;div.updated, div.error&quot;).not(&quot;.below-h2&quot;).insertAfter(&quot;div.wrap h2:first&quot;);d(&quot;#doaction, #doaction2&quot;).click(function(){if(d('select[name=&quot;action&quot;]').val()==&quot;destroy&quot;||d('select[name=&quot;action2&quot;]').val()==&quot;destroy&quot;){return showNotice.warn()}});d(&quot;#destroy_all, #destroy_all2&quot;).click(function(){return showNotice.warn()});d(&quot;#show-settings-link&quot;).click(function(){if(!d(&quot;#screen-options-wrap&quot;).hasClass(&quot;screen-options-open&quot;)){d(&quot;#contextual-help-link-wrap&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}d(&quot;#screen-options-wrap&quot;).slideToggle(&quot;fast&quot;,function(){if(d(this).hasClass(&quot;screen-options-open&quot;)){d(&quot;#show-settings-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right.gif&quot;)'});d(&quot;#contextual-help-link-wrap&quot;).css(&quot;visibility&quot;,&quot;&quot;);d(this).removeClass(&quot;screen-options-open&quot;)}else{d(&quot;#show-settings-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right-up.gif&quot;)'});d(this).addClass(&quot;screen-options-open&quot;)}});return false});d(&quot;#contextual-help-link&quot;).click(function(){if(!d(&quot;#contextual-help-wrap&quot;).hasClass(&quot;contextual-help-open&quot;)){d(&quot;#screen-options-link-wrap&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}d(&quot;#contextual-help-wrap&quot;).slideToggle(&quot;fast&quot;,function(){if(d(this).hasClass(&quot;contextual-help-open&quot;)){d(&quot;#contextual-help-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right.gif&quot;)'});d(&quot;#screen-options-link-wrap&quot;).css(&quot;visibility&quot;,&quot;&quot;);d(this).removeClass(&quot;contextual-help-open&quot;)}else{d(&quot;#contextual-help-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right-up.gif&quot;)'});d(this).addClass(&quot;contextual-help-open&quot;)}});return false});d(&quot;#contextual-help-link-wrap, #screen-options-link-wrap&quot;).show();d(&quot;table:visible tbody .check-column :checkbox&quot;).click(function(g){if(&quot;undefined&quot;==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).parents(&quot;form:first&quot;).find(&quot;:checkbox&quot;);e=a.index(f);c=a.index(this);b=d(this).attr(&quot;checked&quot;);if(0&lt;e&amp;&amp;0&lt;c&amp;&amp;e!=c){a.slice(e,c).attr(&quot;checked&quot;,function(){if(d(this).parents(&quot;tr&quot;).is(&quot;:visible&quot;)){return b?&quot;checked&quot;:&quot;&quot;}return&quot;&quot;})}}f=this;return true});d(&quot;thead :checkbox, tfoot :checkbox&quot;).click(function(i){var j=d(this).attr(&quot;checked&quot;),h=&quot;undefined&quot;==typeof toggleWithKeyboard?false:toggleWithKeyboard,g=i.shiftKey||h;d(this).parents(&quot;form:first&quot;).find(&quot;table tbody:visible&quot;).find(&quot;.check-column :checkbox&quot;).attr(&quot;checked&quot;,function(){if(d(this).parents(&quot;tr&quot;).is(&quot;:hidden&quot;)){return&quot;&quot;}if(g){return d(this).attr(&quot;checked&quot;)?&quot;&quot;:&quot;checked&quot;}else{if(j){return&quot;checked&quot;}}return&quot;&quot;});d(this).parents(&quot;form:first&quot;).find(&quot;table thead:visible, table tfoot:visible&quot;).find(&quot;.check-column :checkbox&quot;).attr(&quot;checked&quot;,function(){if(g){return&quot;&quot;}else{if(j){return&quot;checked&quot;}}return&quot;&quot;})});d(&quot;#default-password-nag-no&quot;).click(function(){setUserSetting(&quot;default_password_nag&quot;,&quot;hide&quot;);d(&quot;div.default-password-nag&quot;).hide();return false})});jQuery(document).ready(function(b){var a=b(&quot;.turbo-nag&quot;);if(!a.length||(&quot;undefined&quot;!=typeof(google)&amp;&amp;google.gears)){return}if(&quot;undefined&quot;!=typeof GearsFactory){return}else{try{if((&quot;undefined&quot;!=typeof window.ActiveXObject&amp;&amp;ActiveXObject(&quot;Gears.Factory&quot;))||(&quot;undefined&quot;!=typeof navigator.mimeTypes&amp;&amp;navigator.mimeTypes[&quot;application/x-googlegears&quot;])){return}}catch(c){}}a.show()});
</del><span class="cx">\ No newline at end of file
</span><ins>+var showNotice,adminMenu,columns,validateForm;(function(a){adminMenu={init:function(){a(&quot;#adminmenu div.wp-menu-toggle&quot;).each(function(){if(a(this).siblings(&quot;.wp-submenu&quot;).length){a(this).click(function(){adminMenu.toggle(a(this).siblings(&quot;.wp-submenu&quot;))})}else{a(this).hide()}});this.favorites();a(&quot;a.separator&quot;).click(function(){if(a(&quot;body&quot;).hasClass(&quot;folded&quot;)){adminMenu.fold(1);deleteUserSetting(&quot;mfold&quot;)}else{adminMenu.fold();setUserSetting(&quot;mfold&quot;,&quot;f&quot;)}return false});if(a(&quot;body&quot;).hasClass(&quot;folded&quot;)){this.fold()}this.restoreMenuState()},restoreMenuState:function(){a(&quot;#adminmenu li.wp-has-submenu&quot;).each(function(c,d){var b=getUserSetting(&quot;m&quot;+c);if(a(d).hasClass(&quot;wp-has-current-submenu&quot;)){return true}if(&quot;o&quot;==b){a(d).addClass(&quot;wp-menu-open&quot;)}else{if(&quot;c&quot;==b){a(d).removeClass(&quot;wp-menu-open&quot;)}}})},toggle:function(b){b.slideToggle(150,function(){b.css(&quot;display&quot;,&quot;&quot;)}).parent().toggleClass(&quot;wp-menu-open&quot;);a(&quot;#adminmenu li.wp-has-submenu&quot;).each(function(d,f){var c=a(f).hasClass(&quot;wp-menu-open&quot;)?&quot;o&quot;:&quot;c&quot;;setUserSetting(&quot;m&quot;+d,c)});return false},fold:function(b){if(b){a(&quot;body&quot;).removeClass(&quot;folded&quot;);a(&quot;#adminmenu li.wp-has-submenu&quot;).unbind()}else{a(&quot;body&quot;).addClass(&quot;folded&quot;);a(&quot;#adminmenu li.wp-has-submenu&quot;).hoverIntent({over:function(j){var d,c,g,k,i;d=a(this).find(&quot;.wp-submenu&quot;);c=d.parent().offset().top+d.height()+1;g=a(&quot;#wpwrap&quot;).height();k=60+c-g;i=a(window).height()+a(&quot;body&quot;).scrollTop()-15;if(i&lt;(c-k)){k=c-i}if(k&gt;1){d.css({marginTop:&quot;-&quot;+k+&quot;px&quot;})}else{if(d.css(&quot;marginTop&quot;)){d.css({marginTop:&quot;&quot;})}}d.addClass(&quot;sub-open&quot;)},out:function(){a(this).find(&quot;.wp-submenu&quot;).removeClass(&quot;sub-open&quot;).css({marginTop:&quot;&quot;})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a(&quot;#favorite-inside&quot;).width(a(&quot;#favorite-actions&quot;).width()-4);a(&quot;#favorite-toggle, #favorite-inside&quot;).bind(&quot;mouseenter&quot;,function(){a(&quot;#favorite-inside&quot;).removeClass(&quot;slideUp&quot;).addClass(&quot;slideDown&quot;);setTimeout(function(){if(a(&quot;#favorite-inside&quot;).hasClass(&quot;slideDown&quot;)){a(&quot;#favorite-inside&quot;).slideDown(100);a(&quot;#favorite-first&quot;).addClass(&quot;slide-down&quot;)}},200)});a(&quot;#favorite-toggle, #favorite-inside&quot;).bind(&quot;mouseleave&quot;,function(){a(&quot;#favorite-inside&quot;).removeClass(&quot;slideDown&quot;).addClass(&quot;slideUp&quot;);setTimeout(function(){if(a(&quot;#favorite-inside&quot;).hasClass(&quot;slideUp&quot;)){a(&quot;#favorite-inside&quot;).slideUp(100,function(){a(&quot;#favorite-first&quot;).removeClass(&quot;slide-down&quot;)})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(&quot;.hide-column-tog&quot;).click(function(){var c=a(this).val(),b=a(this).attr(&quot;checked&quot;);if(b){a(&quot;.column-&quot;+c).show()}else{a(&quot;.column-&quot;+c).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(&quot;.manage-column&quot;).filter(&quot;:hidden&quot;).map(function(){return this.id}).get().join(&quot;,&quot;);a.post(ajaxurl,{action:&quot;hidden-columns&quot;,hidden:b,screenoptionnonce:a(&quot;#screenoptionnonce&quot;).val(),page:pagenow})}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(&quot;.form-required&quot;).filter(function(){return a(&quot;input:visible&quot;,this).val()==&quot;&quot;}).addClass(&quot;form-invalid&quot;).change(function(){a(this).removeClass(&quot;form-invalid&quot;)}).size()}})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||&quot;&quot;;if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d(&quot;.fade&quot;).animate({backgroundColor:&quot;#ffffe0&quot;},300).animate({backgroundColor:&quot;#fffbcc&quot;},300).animate({backgroundColor:&quot;#ffffe0&quot;},300).animate({backgroundColor:&quot;#fffbcc&quot;},300);d(&quot;div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error&quot;).addClass(&quot;below-h2&quot;);d(&quot;div.updated, div.error&quot;).not(&quot;.below-h2&quot;).insertAfter(&quot;div.wrap h2:first&quot;);d(&quot;#show-settings-link&quot;).click(function(){if(!d(&quot;#screen-options-wrap&quot;).hasClass(&quot;screen-options-open&quot;)){d(&quot;#contextual-help-link-wrap&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}d(&quot;#screen-options-wrap&quot;).slideToggle(&quot;fast&quot;,function(){if(d(this).hasClass(&quot;screen-options-open&quot;)){d(&quot;#show-settings-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right.gif&quot;)'});d(&quot;#contextual-help-link-wrap&quot;).css(&quot;visibility&quot;,&quot;&quot;);d(this).removeClass(&quot;screen-options-open&quot;)}else{d(&quot;#show-settings-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right-up.gif&quot;)'});d(this).addClass(&quot;screen-options-open&quot;)}});return false});d(&quot;#contextual-help-link&quot;).click(function(){if(!d(&quot;#contextual-help-wrap&quot;).hasClass(&quot;contextual-help-open&quot;)){d(&quot;#screen-options-link-wrap&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}d(&quot;#contextual-help-wrap&quot;).slideToggle(&quot;fast&quot;,function(){if(d(this).hasClass(&quot;contextual-help-open&quot;)){d(&quot;#contextual-help-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right.gif&quot;)'});d(&quot;#screen-options-link-wrap&quot;).css(&quot;visibility&quot;,&quot;&quot;);d(this).removeClass(&quot;contextual-help-open&quot;)}else{d(&quot;#contextual-help-link&quot;).css({backgroundImage:'url(&quot;images/screen-options-right-up.gif&quot;)'});d(this).addClass(&quot;contextual-help-open&quot;)}});return false});d(&quot;#contextual-help-link-wrap, #screen-options-link-wrap&quot;).show();d(&quot;table:visible tbody .check-column :checkbox&quot;).click(function(g){if(&quot;undefined&quot;==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).parents(&quot;form:first&quot;).find(&quot;:checkbox&quot;);e=a.index(f);c=a.index(this);b=d(this).attr(&quot;checked&quot;);if(0&lt;e&amp;&amp;0&lt;c&amp;&amp;e!=c){a.slice(e,c).attr(&quot;checked&quot;,function(){if(d(this).parents(&quot;tr&quot;).is(&quot;:visible&quot;)){return b?&quot;checked&quot;:&quot;&quot;}return&quot;&quot;})}}f=this;return true});d(&quot;thead :checkbox, tfoot :checkbox&quot;).click(function(i){var j=d(this).attr(&quot;checked&quot;),h=&quot;undefined&quot;==typeof toggleWithKeyboard?false:toggleWithKeyboard,g=i.shiftKey||h;d(this).parents(&quot;form:first&quot;).find(&quot;table tbody:visible&quot;).find(&quot;.check-column :checkbox&quot;).attr(&quot;checked&quot;,function(){if(d(this).parents(&quot;tr&quot;).is(&quot;:hidden&quot;)){return&quot;&quot;}if(g){return d(this).attr(&quot;checked&quot;)?&quot;&quot;:&quot;checked&quot;}else{if(j){return&quot;checked&quot;}}return&quot;&quot;});d(this).parents(&quot;form:first&quot;).find(&quot;table thead:visible, table tfoot:visible&quot;).find(&quot;.check-column :checkbox&quot;).attr(&quot;checked&quot;,function(){if(g){return&quot;&quot;}else{if(j){return&quot;checked&quot;}}return&quot;&quot;})});d(&quot;#default-password-nag-no&quot;).click(function(){setUserSetting(&quot;default_password_nag&quot;,&quot;hide&quot;);d(&quot;div.default-password-nag&quot;).hide();return false})});jQuery(document).ready(function(b){var a=b(&quot;.turbo-nag&quot;);if(!a.length||(&quot;undefined&quot;!=typeof(google)&amp;&amp;google.gears)){return}if(&quot;undefined&quot;!=typeof GearsFactory){return}else{try{if((&quot;undefined&quot;!=typeof window.ActiveXObject&amp;&amp;ActiveXObject(&quot;Gears.Factory&quot;))||(&quot;undefined&quot;!=typeof navigator.mimeTypes&amp;&amp;navigator.mimeTypes[&quot;application/x-googlegears&quot;])){return}}catch(c){}}a.show()});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjseditcommentsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/edit-comments.dev.js (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/edit-comments.dev.js        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/js/edit-comments.dev.js        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -38,9 +38,6 @@
</span><span class="cx">                 settings.data._page = pageInput.val();
</span><span class="cx">                 settings.data._url = document.location.href;
</span><span class="cx"> 
</span><del>-                if ( 'undefined' != showNotice &amp;&amp; settings.data.action &amp;&amp; settings.data.action == 'delete-comment' &amp;&amp; settings.data.deleted)
-                        return showNotice.warn() ? settings : false;
-
</del><span class="cx">                 return settings;
</span><span class="cx">         };
</span><span class="cx"> 
</span><span class="lines">@@ -101,17 +98,15 @@
</span><span class="cx">                         a.html(n);
</span><span class="cx">                 });
</span><span class="cx"> 
</span><del>-                $('span.deleted-count').each( function() {
</del><ins>+                $('span.trash-count').each( function() {
</ins><span class="cx">                         var a = $(this), n;
</span><span class="cx">                         n = a.html().replace(/[ ,.]+/g, '');
</span><span class="cx">                         n = parseInt(n,10);
</span><span class="cx">                         if ( isNaN(n) ) return;
</span><del>-                        if ( $(settings.target).parents( 'span.delete' ).size() &amp;&amp; $('#' + settings.element).is('.deleted,.spam') ) { // we destroyed a deleted or spam comment
-                                n--;
-                        } else if ( $(settings.target).parents( 'span.delete' ).size() ) { // we deleted a comment
-                                n++;
-                        } else if ( $('#' + settings.element).is('.deleted') ) { // we approved or spammed a deleted comment
-                                n--;
</del><ins>+                        if ( $(settings.target).parents( 'span.trash' ).size() ) { // we trashed a comment
+                                n = n + 1;
+                        } else if ( $('#' + settings.element).is('.trash') ) { // we deleted or untrashed a trash comment
+                                n = n - 1;
</ins><span class="cx">                         }
</span><span class="cx">                         if ( n &lt; 0 ) { n = 0; }
</span><span class="cx">                         n = n.toString();
</span></span></pre></div>
<a id="trunkwpadminjseditcommentsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/edit-comments.js (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/edit-comments.js        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/js/edit-comments.js        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('#comments-form .tablenav :input[name=&quot;_total&quot;]');i=a('#comments-form .tablenav :input[name=&quot;_per_page&quot;]');h=a('#comments-form .tablenav :input[name=&quot;_page&quot;]');c=function(k,j){var l=a(&quot;#&quot;+j.element);if(l.is(&quot;.unapproved&quot;)){l.find(&quot;div.comment_status&quot;).html(&quot;0&quot;)}else{l.find(&quot;div.comment_status&quot;).html(&quot;1&quot;)}a(&quot;span.pending-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}o=o+(a(&quot;#&quot;+j.element).is(&quot;.&quot;+j.dimClass)?1:-1);if(o&lt;0){o=0}m.parents(&quot;#awaiting-mod&quot;)[0==o?&quot;addClass&quot;:&quot;removeClass&quot;](&quot;count-0&quot;);o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)})};e=function(j){j.data._total=g.val();j.data._per_page=i.val();j.data._page=h.val();j.data._url=document.location.href;if(&quot;undefined&quot;!=showNotice&amp;&amp;j.data.action&amp;&amp;j.data.action==&quot;delete-comment&quot;&amp;&amp;j.data.deleted){return showNotice.warn()?j:false}return j};d=function(j,k,l){if(k&lt;f){return}g.val(j.toString());if(l){f=k}a(&quot;span.total-type-count&quot;).each(function(){var m=a(this),o;o=g.val().toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)})};b=function(l,j){a(&quot;span.pending-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}if(a(&quot;#&quot;+j.element).is(&quot;.unapproved&quot;)){o=o-1}else{if(a(j.target).parents(&quot;span.unapprove&quot;).size()){o=o+1}}if(o&lt;0){o=0}m.parents(&quot;#awaiting-mod&quot;)[0==o?&quot;addClass&quot;:&quot;removeClass&quot;](&quot;count-0&quot;);o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)});a(&quot;span.spam-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents(&quot;span.spam&quot;).size()){o=o+1}else{if(a(&quot;#&quot;+j.element).is(&quot;.spam&quot;)){o=o-1}}if(o&lt;0){o=0}o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)});a(&quot;span.deleted-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents(&quot;span.delete&quot;).size()&amp;&amp;a(&quot;#&quot;+j.element).is(&quot;.deleted,.spam&quot;)){o--}else{if(a(j.target).parents(&quot;span.delete&quot;).size()){o++}else{if(a(&quot;#&quot;+j.element).is(&quot;.deleted&quot;)){o--}}}if(o&lt;0){o=0}o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)});if((&quot;object&quot;==typeof l)&amp;&amp;f&lt;j.parsed.responses[0].supplemental.time){d(j.parsed.responses[0].supplemental.total,j.parsed.responses[0].supplemental.time,true);if(a.trim(j.parsed.responses[0].supplemental.pageLinks)){a(&quot;.tablenav-pages&quot;).find(&quot;.page-numbers&quot;).remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks))}else{if(&quot;undefined&quot;!=typeof j.parsed.responses[0].supplemental.pageLinks){a(&quot;.tablenav-pages&quot;).find(&quot;.page-numbers&quot;).remove()}}}else{var k=parseInt(g.val(),10);if(k--&lt;0){k=0}d(k,l,false)}if(theExtraList.size()==0||theExtraList.children().size()==0){return}theList.get(0).wpList.add(theExtraList.children(&quot;:eq(0)&quot;).remove().clone());a(&quot;#get-extra-comments&quot;).submit()};theExtraList=a(&quot;#the-extra-comment-list&quot;).wpList({alt:&quot;&quot;,delColor:&quot;none&quot;,addColor:&quot;none&quot;});theList=a(&quot;#the-comment-list&quot;).wpList({alt:&quot;&quot;,delBefore:e,dimAfter:c,delAfter:b,addColor:&quot;none&quot;})};commentReply={init:function(){var b=a(&quot;#replyrow&quot;);a(&quot;a.cancel&quot;,b).click(function(){return commentReply.revert()});a(&quot;a.save&quot;,b).click(function(){return commentReply.send()});a(&quot;input#author, input#author-email, input#author-url&quot;,b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a(&quot;#the-comment-list .column-comment &gt; p&quot;).dblclick(function(){commentReply.toggle(a(this).parent())});a(&quot;#doaction, #doaction2, #post-query-submit&quot;).click(function(c){if(a(&quot;#the-comment-list #replyrow&quot;).length&gt;0){commentReply.close()}});this.comments_listing=a('#comments-form &gt; input[name=&quot;comment_status&quot;]').val()||&quot;&quot;},addEvents:function(b){b.each(function(){a(this).find(&quot;.column-comment &gt; p&quot;).dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css(&quot;display&quot;)!=&quot;none&quot;){a(b).find(&quot;a.vim-q&quot;).click()}},revert:function(){if(a(&quot;#the-comment-list #replyrow&quot;).length&lt;1){return false}a(&quot;#replyrow&quot;).fadeOut(&quot;fast&quot;,function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn(&quot;fast&quot;).css(&quot;backgroundColor&quot;,&quot;&quot;);a(&quot;#com-reply&quot;).append(a(&quot;#replyrow&quot;));a(&quot;#replycontent&quot;).val(&quot;&quot;);a(&quot;#edithead input&quot;).val(&quot;&quot;);a(&quot;#replysubmit .error&quot;).html(&quot;&quot;).hide();a(&quot;#replysubmit .waiting&quot;).hide();if(a.browser.msie){a(&quot;#replycontainer, #replycontent&quot;).css(&quot;height&quot;,&quot;120px&quot;)}else{a(&quot;#replycontainer&quot;).resizable(&quot;destroy&quot;).css(&quot;height&quot;,&quot;120px&quot;)}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o=&quot;#comment-&quot;+i;a(&quot;#replyrow td&quot;).attr(&quot;colspan&quot;,a(&quot;.widefat thead th:visible&quot;).length);d=a(&quot;#replyrow&quot;),rowData=a(&quot;#inline-&quot;+i);b=e.act=(c==&quot;edit&quot;)?&quot;edit-comment&quot;:&quot;replyto-comment&quot;;a(&quot;#action&quot;,d).val(b);a(&quot;#comment_post_ID&quot;,d).val(g);a(&quot;#comment_ID&quot;,d).val(i);if(c==&quot;edit&quot;){a(&quot;#author&quot;,d).val(a(&quot;div.author&quot;,rowData).text());a(&quot;#author-email&quot;,d).val(a(&quot;div.author-email&quot;,rowData).text());a(&quot;#author-url&quot;,d).val(a(&quot;div.author-url&quot;,rowData).text());a(&quot;#status&quot;,d).val(a(&quot;div.comment_status&quot;,rowData).text());a(&quot;#replycontent&quot;,d).val(a(&quot;textarea.comment&quot;,rowData).val());a(&quot;#edithead, #savebtn&quot;,d).show();a(&quot;#replyhead, #replybtn&quot;,d).hide();f=a(e.o).height();if(f&gt;220){if(a.browser.msie){a(&quot;#replycontainer, #replycontent&quot;,d).height(f-105)}else{a(&quot;#replycontainer&quot;,d).height(f-105)}}a(e.o).after(d.hide()).fadeOut(&quot;fast&quot;,function(){a(&quot;#replyrow&quot;).fadeIn(&quot;fast&quot;)})}else{a(&quot;#edithead, #savebtn&quot;,d).hide();a(&quot;#replyhead, #replybtn&quot;,d).show();a(e.o).after(d);a(&quot;#replyrow&quot;).hide().fadeIn(&quot;fast&quot;)}if(!a.browser.msie){a(&quot;#replycontainer&quot;).resizable({handles:&quot;s&quot;,axis:&quot;y&quot;,minHeight:80,stop:function(){a(&quot;#replycontainer&quot;).width(&quot;auto&quot;)}})}setTimeout(function(){var l,j,m,h,k;l=a(&quot;#replyrow&quot;).offset().top;j=l+a(&quot;#replyrow&quot;).height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20&lt;j){window.scroll(0,j-h+35)}else{if(l-20&lt;m){window.scroll(0,l-35)}}a(&quot;#replycontent&quot;).focus().keyup(function(n){if(n.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a(&quot;#replysubmit .waiting&quot;).show();a(&quot;#replyrow input&quot;).each(function(){b[a(this).attr(&quot;name&quot;)]=a(this).val()});b.content=a(&quot;#replycontent&quot;).val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:&quot;POST&quot;,url:wpListL10n.url,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)==&quot;string&quot;){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}if(&quot;edit-comment&quot;==this.act){a(this.o).remove()}e=e.responses[0];g=e.data;a(g).hide();a(&quot;#replyrow&quot;).after(g);this.o=f=&quot;#comment-&quot;+e.id;this.revert();this.addEvents(a(f));d=a(f).hasClass(&quot;unapproved&quot;)?&quot;#ffffe0&quot;:&quot;#fff&quot;;a(f).animate({backgroundColor:&quot;#CCEEBB&quot;},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a(&quot;#replysubmit .waiting&quot;).hide();if(b.responseText){c=b.responseText.replace(/&lt;.[^&lt;&gt;]*?&gt;/g,&quot;&quot;)}if(c){a(&quot;#replysubmit .error&quot;).html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a(&quot;span.delete a.delete&quot;).click(function(){return false});if(typeof QTags!=&quot;undefined&quot;){ed_reply=new QTags(&quot;ed_reply&quot;,&quot;replycontent&quot;,&quot;replycontainer&quot;,&quot;more&quot;)}if(typeof a.table_hotkeys!=&quot;undefined&quot;){e=function(f){return function(){var h,g;h=&quot;next&quot;==f?&quot;first&quot;:&quot;last&quot;;g=a(&quot;.&quot;+f+&quot;.page-numbers&quot;);if(g.length){window.location=g[0].href.replace(/\&amp;hotkeys_highlight_(first|last)=1/g,&quot;&quot;)+&quot;&amp;hotkeys_highlight_&quot;+h+&quot;=1&quot;}}};b=function(g,f){window.location=a(&quot;span.edit a&quot;,f).attr(&quot;href&quot;)};c=function(){toggleWithKeyboard=true;a(&quot;#comments-form thead #cb input:checkbox&quot;).click().attr(&quot;checked&quot;,&quot;&quot;);toggleWithKeyboard=false};d=function(f){return function(h,g){a(&quot;option[value=&quot;+f+&quot;]&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);a(&quot;form#comments-form&quot;)[0].submit()}};a.table_hotkeys(a(&quot;table.widefat&quot;),[&quot;a&quot;,&quot;u&quot;,&quot;s&quot;,&quot;d&quot;,&quot;r&quot;,&quot;q&quot;,[&quot;e&quot;,b],[&quot;shift+a&quot;,d(&quot;approve&quot;)],[&quot;shift+s&quot;,d(&quot;markspam&quot;)],[&quot;shift+d&quot;,d(&quot;delete&quot;)],[&quot;shift+x&quot;,c],[&quot;shift+u&quot;,d(&quot;unapprove&quot;)]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e(&quot;prev&quot;),next_page_link_cb:e(&quot;next&quot;)})}})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('#comments-form .tablenav :input[name=&quot;_total&quot;]');i=a('#comments-form .tablenav :input[name=&quot;_per_page&quot;]');h=a('#comments-form .tablenav :input[name=&quot;_page&quot;]');c=function(k,j){var l=a(&quot;#&quot;+j.element);if(l.is(&quot;.unapproved&quot;)){l.find(&quot;div.comment_status&quot;).html(&quot;0&quot;)}else{l.find(&quot;div.comment_status&quot;).html(&quot;1&quot;)}a(&quot;span.pending-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}o=o+(a(&quot;#&quot;+j.element).is(&quot;.&quot;+j.dimClass)?1:-1);if(o&lt;0){o=0}m.parents(&quot;#awaiting-mod&quot;)[0==o?&quot;addClass&quot;:&quot;removeClass&quot;](&quot;count-0&quot;);o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)})};e=function(j){j.data._total=g.val();j.data._per_page=i.val();j.data._page=h.val();j.data._url=document.location.href;return j};d=function(j,k,l){if(k&lt;f){return}g.val(j.toString());if(l){f=k}a(&quot;span.total-type-count&quot;).each(function(){var m=a(this),o;o=g.val().toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)})};b=function(l,j){a(&quot;span.pending-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}if(a(&quot;#&quot;+j.element).is(&quot;.unapproved&quot;)){o=o-1}else{if(a(j.target).parents(&quot;span.unapprove&quot;).size()){o=o+1}}if(o&lt;0){o=0}m.parents(&quot;#awaiting-mod&quot;)[0==o?&quot;addClass&quot;:&quot;removeClass&quot;](&quot;count-0&quot;);o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)});a(&quot;span.spam-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents(&quot;span.spam&quot;).size()){o=o+1}else{if(a(&quot;#&quot;+j.element).is(&quot;.spam&quot;)){o=o-1}}if(o&lt;0){o=0}o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)});a(&quot;span.trash-count&quot;).each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,&quot;&quot;);o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents(&quot;span.trash&quot;).size()){o=o+1}else{if(a(&quot;#&quot;+j.element).is(&quot;.trash&quot;)){o=o-1}}if(o&lt;0){o=0}o=o.toString();if(o.length&gt;3){o=o.substr(0,o.length-3)+&quot; &quot;+o.substr(-3)}m.html(o)});if((&quot;object&quot;==typeof l)&amp;&amp;f&lt;j.parsed.responses[0].supplemental.time){d(j.parsed.responses[0].supplemental.total,j.parsed.responses[0].supplemental.time,true);if(a.trim(j.parsed.responses[0].supplemental.pageLinks)){a(&quot;.tablenav-pages&quot;).find(&quot;.page-numbers&quot;).remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks))}else{if(&quot;undefined&quot;!=typeof j.parsed.responses[0].supplemental.pageLinks){a(&quot;.tablenav-pages&quot;).find(&quot;.page-numbers&quot;).remove()}}}else{var k=parseInt(g.val(),10);if(k--&lt;0){k=0}d(k,l,false)}if(theExtraList.size()==0||theExtraList.children().size()==0){return}theList.get(0).wpList.add(theExtraList.children(&quot;:eq(0)&quot;).remove().clone());a(&quot;#get-extra-comments&quot;).submit()};theExtraList=a(&quot;#the-extra-comment-list&quot;).wpList({alt:&quot;&quot;,delColor:&quot;none&quot;,addColor:&quot;none&quot;});theList=a(&quot;#the-comment-list&quot;).wpList({alt:&quot;&quot;,delBefore:e,dimAfter:c,delAfter:b,addColor:&quot;none&quot;})};commentReply={init:function(){var b=a(&quot;#replyrow&quot;);a(&quot;a.cancel&quot;,b).click(function(){return commentReply.revert()});a(&quot;a.save&quot;,b).click(function(){return commentReply.send()});a(&quot;input#author, input#author-email, input#author-url&quot;,b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a(&quot;#the-comment-list .column-comment &gt; p&quot;).dblclick(function(){commentReply.toggle(a(this).parent())});a(&quot;#doaction, #doaction2, #post-query-submit&quot;).click(function(c){if(a(&quot;#the-comment-list #replyrow&quot;).length&gt;0){commentReply.close()}});this.comments_listing=a('#comments-form &gt; input[name=&quot;comment_status&quot;]').val()||&quot;&quot;},addEvents:function(b){b.each(function(){a(this).find(&quot;.column-comment &gt; p&quot;).dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css(&quot;display&quot;)!=&quot;none&quot;){a(b).find(&quot;a.vim-q&quot;).click()}},revert:function(){if(a(&quot;#the-comment-list #replyrow&quot;).length&lt;1){return false}a(&quot;#replyrow&quot;).fadeOut(&quot;fast&quot;,function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn(&quot;fast&quot;).css(&quot;backgroundColor&quot;,&quot;&quot;);a(&quot;#com-reply&quot;).append(a(&quot;#replyrow&quot;));a(&quot;#replycontent&quot;).val(&quot;&quot;);a(&quot;#edithead input&quot;).val(&quot;&quot;);a(&quot;#replysubmit .error&quot;).html(&quot;&quot;).hide();a(&quot;#replysubmit .waiting&quot;).hide();if(a.browser.msie){a(&quot;#replycontainer, #replycontent&quot;).css(&quot;height&quot;,&quot;120px&quot;)}else{a(&quot;#replycontainer&quot;).resizable(&quot;destroy&quot;).css(&quot;height&quot;,&quot;120px&quot;)}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o=&quot;#comment-&quot;+i;a(&quot;#replyrow td&quot;).attr(&quot;colspan&quot;,a(&quot;.widefat thead th:visible&quot;).length);d=a(&quot;#replyrow&quot;),rowData=a(&quot;#inline-&quot;+i);b=e.act=(c==&quot;edit&quot;)?&quot;edit-comment&quot;:&quot;replyto-comment&quot;;a(&quot;#action&quot;,d).val(b);a(&quot;#comment_post_ID&quot;,d).val(g);a(&quot;#comment_ID&quot;,d).val(i);if(c==&quot;edit&quot;){a(&quot;#author&quot;,d).val(a(&quot;div.author&quot;,rowData).text());a(&quot;#author-email&quot;,d).val(a(&quot;div.author-email&quot;,rowData).text());a(&quot;#author-url&quot;,d).val(a(&quot;div.author-url&quot;,rowData).text());a(&quot;#status&quot;,d).val(a(&quot;div.comment_status&quot;,rowData).text());a(&quot;#replycontent&quot;,d).val(a(&quot;textarea.comment&quot;,rowData).val());a(&quot;#edithead, #savebtn&quot;,d).show();a(&quot;#replyhead, #replybtn&quot;,d).hide();f=a(e.o).height();if(f&gt;220){if(a.browser.msie){a(&quot;#replycontainer, #replycontent&quot;,d).height(f-105)}else{a(&quot;#replycontainer&quot;,d).height(f-105)}}a(e.o).after(d.hide()).fadeOut(&quot;fast&quot;,function(){a(&quot;#replyrow&quot;).fadeIn(&quot;fast&quot;)})}else{a(&quot;#edithead, #savebtn&quot;,d).hide();a(&quot;#replyhead, #replybtn&quot;,d).show();a(e.o).after(d);a(&quot;#replyrow&quot;).hide().fadeIn(&quot;fast&quot;)}if(!a.browser.msie){a(&quot;#replycontainer&quot;).resizable({handles:&quot;s&quot;,axis:&quot;y&quot;,minHeight:80,stop:function(){a(&quot;#replycontainer&quot;).width(&quot;auto&quot;)}})}setTimeout(function(){var l,j,m,h,k;l=a(&quot;#replyrow&quot;).offset().top;j=l+a(&quot;#replyrow&quot;).height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20&lt;j){window.scroll(0,j-h+35)}else{if(l-20&lt;m){window.scroll(0,l-35)}}a(&quot;#replycontent&quot;).focus().keyup(function(n){if(n.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a(&quot;#replysubmit .waiting&quot;).show();a(&quot;#replyrow input&quot;).each(function(){b[a(this).attr(&quot;name&quot;)]=a(this).val()});b.content=a(&quot;#replycontent&quot;).val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:&quot;POST&quot;,url:wpListL10n.url,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)==&quot;string&quot;){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}if(&quot;edit-comment&quot;==this.act){a(this.o).remove()}e=e.responses[0];g=e.data;a(g).hide();a(&quot;#replyrow&quot;).after(g);this.o=f=&quot;#comment-&quot;+e.id;this.revert();this.addEvents(a(f));d=a(f).hasClass(&quot;unapproved&quot;)?&quot;#ffffe0&quot;:&quot;#fff&quot;;a(f).animate({backgroundColor:&quot;#CCEEBB&quot;},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a(&quot;#replysubmit .waiting&quot;).hide();if(b.responseText){c=b.responseText.replace(/&lt;.[^&lt;&gt;]*?&gt;/g,&quot;&quot;)}if(c){a(&quot;#replysubmit .error&quot;).html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a(&quot;span.delete a.delete&quot;).click(function(){return false});if(typeof QTags!=&quot;undefined&quot;){ed_reply=new QTags(&quot;ed_reply&quot;,&quot;replycontent&quot;,&quot;replycontainer&quot;,&quot;more&quot;)}if(typeof a.table_hotkeys!=&quot;undefined&quot;){e=function(f){return function(){var h,g;h=&quot;next&quot;==f?&quot;first&quot;:&quot;last&quot;;g=a(&quot;.&quot;+f+&quot;.page-numbers&quot;);if(g.length){window.location=g[0].href.replace(/\&amp;hotkeys_highlight_(first|last)=1/g,&quot;&quot;)+&quot;&amp;hotkeys_highlight_&quot;+h+&quot;=1&quot;}}};b=function(g,f){window.location=a(&quot;span.edit a&quot;,f).attr(&quot;href&quot;)};c=function(){toggleWithKeyboard=true;a(&quot;#comments-form thead #cb input:checkbox&quot;).click().attr(&quot;checked&quot;,&quot;&quot;);toggleWithKeyboard=false};d=function(f){return function(h,g){a(&quot;option[value=&quot;+f+&quot;]&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);a(&quot;form#comments-form&quot;)[0].submit()}};a.table_hotkeys(a(&quot;table.widefat&quot;),[&quot;a&quot;,&quot;u&quot;,&quot;s&quot;,&quot;d&quot;,&quot;r&quot;,&quot;q&quot;,[&quot;e&quot;,b],[&quot;shift+a&quot;,d(&quot;approve&quot;)],[&quot;shift+s&quot;,d(&quot;markspam&quot;)],[&quot;shift+d&quot;,d(&quot;delete&quot;)],[&quot;shift+x&quot;,c],[&quot;shift+u&quot;,d(&quot;unapprove&quot;)]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e(&quot;prev&quot;),next_page_link_cb:e(&quot;next&quot;)})}})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/media.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/media.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/media.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -58,6 +58,9 @@
</span><span class="cx"> 
</span><span class="cx">         $att = get_post($att_id);
</span><span class="cx"> 
</span><ins>+        if ( empty($att-&gt;ID) ) wp_die( __('You attempted to edit an attachment that doesn&amp;#8217;t exist. Perhaps it was deleted?') );
+        if ( $att-&gt;post_status == 'trash' ) wp_die( __('You can&amp;#8217;t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.') );
+        
</ins><span class="cx">         add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
</span><span class="cx"> 
</span><span class="cx">         wp_enqueue_script( 'wp-ajax-response' );
</span></span></pre></div>
<a id="trunkwpadminpagephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/page.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/page.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/page.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">         $post = get_post_to_edit($page_ID);
</span><span class="cx"> 
</span><span class="cx">         if ( empty($post-&gt;ID) ) wp_die( __('You attempted to edit a page that doesn&amp;#8217;t exist. Perhaps it was deleted?') );
</span><ins>+        if ( $post-&gt;post_status == 'trash' ) wp_die( __('You can&amp;#8217;t edit this page because it is in the Trash. Please move it out of the Trash and try again.') );
</ins><span class="cx"> 
</span><span class="cx">         if ( 'page' != $post-&gt;post_type ) {
</span><span class="cx">                 wp_redirect( get_edit_post_link( $post_ID, 'url' ) );
</span><span class="lines">@@ -140,6 +141,46 @@
</span><span class="cx">         exit();
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+case 'trash':
+        $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
+        check_admin_referer('trash-page_' . $post_id);
+
+        $post = &amp; get_post($post_id);
+
+        if ( !current_user_can('delete_page', $page_id) )
+                wp_die( __('You are not allowed to move this page to the trash.') );
+
+        if ( !wp_trash_post($post_id) )
+                wp_die( __('Error in removing from trash...') );
+
+        $sendback = wp_get_referer();
+        if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?trashed=1');
+        elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
+        else $sendback = add_query_arg('trashed', 1, $sendback);
+        wp_redirect($sendback);
+        exit();
+        break;
+
+case 'untrash':
+        $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
+        check_admin_referer('untrash-page_' . $post_id);
+
+        $post = &amp; get_post($post_id);
+
+        if ( !current_user_can('delete_page', $page_id) )
+                wp_die( __('You are not allowed to remove this page form the trash.') );
+
+        if ( !wp_untrash_post($post_id) )
+                wp_die( __('Error in removing from trash...') );
+
+        $sendback = wp_get_referer();
+        if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?untrashed=1');
+        elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
+        else $sendback = add_query_arg('untrashed', 1, $sendback);
+        wp_redirect($sendback);
+        exit();
+        break;
+
</ins><span class="cx"> case 'delete':
</span><span class="cx">         $page_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
</span><span class="cx">         check_admin_referer('delete-page_' .  $page_id);
</span></span></pre></div>
<a id="trunkwpadminpostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/post.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/post.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/post.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -116,6 +116,7 @@
</span><span class="cx">         $post = get_post($post_ID);
</span><span class="cx"> 
</span><span class="cx">         if ( empty($post-&gt;ID) ) wp_die( __('You attempted to edit a post that doesn&amp;#8217;t exist. Perhaps it was deleted?') );
</span><ins>+        if ( $post-&gt;post_status == 'trash' ) wp_die( __('You can&amp;#8217;t edit this post because it is in the Trash. Please move it out of the Trash and try again.') );
</ins><span class="cx"> 
</span><span class="cx">         if ( 'post' != $post-&gt;post_type ) {
</span><span class="cx">                 wp_redirect( get_edit_post_link( $post-&gt;ID, 'url' ) );
</span><span class="lines">@@ -181,6 +182,46 @@
</span><span class="cx">         exit();
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+case 'trash':
+        $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
+        check_admin_referer('trash-post_' . $post_id);
+
+        $post = &amp; get_post($post_id);
+
+        if ( !current_user_can('delete_post', $post_id) )
+                wp_die( __('You are not allowed to move this post to the trash.') );
+
+        if ( ! wp_trash_post($post_id) )
+                wp_die( __('Error in moving to trash...') );
+
+        $sendback = wp_get_referer();
+        if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?trashed=1');
+        elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
+        else $sendback = add_query_arg('trashed', 1, $sendback);
+        wp_redirect($sendback);
+        exit();
+        break;
+
+case 'untrash':
+        $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
+        check_admin_referer('untrash-post_' . $post_id);
+
+        $post = &amp; get_post($post_id);
+
+        if ( !current_user_can('delete_post', $post_id) )
+                wp_die( __('You are not allowed to remove this post from the trash.') );
+
+        if ( ! wp_untrash_post($post_id) )
+                wp_die( __('Error in removing from trash...') );
+
+        $sendback = wp_get_referer();
+        if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?untrashed=1');
+        elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
+        else $sendback = add_query_arg('untrashed', 1, $sendback);
+        wp_redirect($sendback);
+        exit();
+        break;
+
</ins><span class="cx"> case 'delete':
</span><span class="cx">         $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
</span><span class="cx">         check_admin_referer('delete-post_' . $post_id);
</span></span></pre></div>
<a id="trunkwpadminuploadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/upload.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/upload.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/upload.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -67,33 +67,60 @@
</span><span class="cx">                 exit;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-} elseif ( isset($_GET['action']) &amp;&amp; isset($_GET['media']) &amp;&amp; ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
</del><ins>+} elseif ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
</ins><span class="cx">         check_admin_referer('bulk-media');
</span><del>-        $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
</del><ins>+        
+        if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+                $post_ids = $wpdb-&gt;get_col( &quot;SELECT ID FROM $wpdb-&gt;posts WHERE post_type='attachment' AND post_status = 'trash'&quot; );
+                $doaction = 'delete';
+        } elseif ( ($_GET['action'] != -1 || $_GET['action2'] != -1) &amp;&amp; isset($_GET['media']) ) {
+                $post_ids = $_GET['media'];
+                $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
+        } else
+                wp_redirect($_SERVER['HTTP_REFERER']);
+        
+        $location = 'upload.php';
+        if ( $referer = wp_get_referer() ) {
+                if ( false !== strpos($referer, 'upload.php') )
+                        $location = $referer;
+        }
</ins><span class="cx"> 
</span><del>-        if ( 'delete' == $doaction ) {
-                foreach( (array) $_GET['media'] as $post_id_del ) {
-                        $post_del = &amp; get_post($post_id_del);
-
-                        if ( !current_user_can('delete_post', $post_id_del) )
-                                wp_die( __('You are not allowed to delete this post.') );
-
-                        if ( $post_del-&gt;post_type == 'attachment' )
-                                if ( ! wp_delete_attachment($post_id_del) )
</del><ins>+        switch ( $doaction ) {
+                case 'trash':
+                        foreach( (array) $post_ids as $post_id ) {
+                                if ( !current_user_can('delete_post', $post_id) )
+                                        wp_die( __('You are not allowed to move this post to the trash.') );
+                                
+                                if ( !wp_trash_post($post_id) )
+                                        wp_die( __('Error in moving to trash...') );
+                        }
+                        $location = add_query_arg('message', 4, $location);
+                        break;
+                case 'untrash':
+                        foreach( (array) $post_ids as $post_id ) {
+                                if ( !current_user_can('delete_post', $post_id) )
+                                        wp_die( __('You are not allowed to remove this post from the trash.') );
+                                
+                                if ( !wp_untrash_post($post_id) )
+                                        wp_die( __('Error in restoring from trash...') );
+                        }
+                        $location = add_query_arg('message', 5, $location);
+                        break;
+                case 'delete':
+                        foreach( (array) $post_ids as $post_id_del ) {
+                                if ( !current_user_can('delete_post', $post_id_del) )
+                                        wp_die( __('You are not allowed to delete this post.') );
+        
+                                if ( !wp_delete_attachment($post_id_del) )
</ins><span class="cx">                                         wp_die( __('Error in deleting...') );
</span><del>-                }
</del><ins>+                        }
+                        $location = add_query_arg('message', 2, $location);
+                        break;
+        }
</ins><span class="cx"> 
</span><del>-                $location = 'upload.php';
-                if ( $referer = wp_get_referer() ) {
-                        if ( false !== strpos($referer, 'upload.php') )
-                                $location = $referer;
-                }
-
-                $location = add_query_arg('message', 2, $location);
-                $location = remove_query_arg('posted', $location);
-                wp_redirect($location);
-                exit;
-        }
</del><ins>+        $location = remove_query_arg('posted', $location);
+        wp_redirect($location);
+        exit;
</ins><span class="cx"> } elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
</span><span class="cx">          wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
</span><span class="cx">          exit;
</span><span class="lines">@@ -115,7 +142,7 @@
</span><span class="cx">                 $orphans = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND ID IN ($lost) LIMIT $start, 50&quot; );
</span><span class="cx">         } else {
</span><span class="cx">                 $start = ( $_GET['paged'] - 1 ) * 25;
</span><del>-                $orphans = $wpdb-&gt;get_results( &quot;SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND post_parent &lt; 1 LIMIT $start, 25&quot; );
</del><ins>+                $orphans = $wpdb-&gt;get_results( &quot;SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent &lt; 1 LIMIT $start, 25&quot; );
</ins><span class="cx">                 $page_links_total = ceil($wpdb-&gt;get_var( &quot;SELECT FOUND_ROWS()&quot; ) / 25);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -135,6 +162,8 @@
</span><span class="cx">         list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+$is_trash = ( isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' );
+
</ins><span class="cx"> wp_enqueue_script('media');
</span><span class="cx"> require_once('admin-header.php'); ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -153,6 +182,8 @@
</span><span class="cx"> $messages[1] = __('Media attachment updated.');
</span><span class="cx"> $messages[2] = __('Media deleted.');
</span><span class="cx"> $messages[3] = __('Error saving media attachment.');
</span><ins>+$messages[4] = __('Media moved to Trash.');
+$messages[5] = __('Media removed from Trash.');
</ins><span class="cx"> 
</span><span class="cx"> if ( isset($_GET['message']) &amp;&amp; (int) $_GET['message'] ) {
</span><span class="cx">         $message = $messages[$_GET['message']];
</span><span class="lines">@@ -180,13 +211,13 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> $type_links = array();
</span><span class="cx"> $_num_posts = (array) wp_count_attachments();
</span><del>-$_total_posts = array_sum( $_num_posts );
</del><ins>+$_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
</ins><span class="cx"> $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
</span><span class="cx"> foreach ( $matches as $type =&gt; $reals )
</span><span class="cx">         foreach ( $reals as $real )
</span><span class="cx">                 $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
</span><span class="cx"> 
</span><del>-$class = empty($_GET['post_mime_type']) &amp;&amp; ! isset($_GET['detached']) ? ' class=&quot;current&quot;' : '';
</del><ins>+$class = ( empty($_GET['post_mime_type']) &amp;&amp; !isset($_GET['detached']) &amp;&amp; !isset($_GET['status']) ) ? ' class=&quot;current&quot;' : '';
</ins><span class="cx"> $type_links[] = &quot;&lt;li&gt;&lt;a href='upload.php'$class&gt;&quot; . sprintf( _nx( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '&lt;/a&gt;';
</span><span class="cx"> foreach ( $post_mime_types as $mime_type =&gt; $label ) {
</span><span class="cx">         $class = '';
</span><span class="lines">@@ -199,8 +230,8 @@
</span><span class="cx"> 
</span><span class="cx">         $type_links[] = &quot;&lt;li&gt;&lt;a href='upload.php?post_mime_type=$mime_type'$class&gt;&quot; . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '&lt;/a&gt;';
</span><span class="cx"> }
</span><del>-$class = isset($_GET['detached']) ? ' class=&quot;current&quot;' : '';
-$type_links[] = '&lt;li&gt;&lt;a href=&quot;upload.php?detached=1&quot;' . $class . '&gt;' . __('Unattached') . '&lt;/a&gt;';
</del><ins>+$type_links[] = '&lt;li&gt;&lt;a href=&quot;upload.php?detached=1&quot;' . ( isset($_GET['detached']) ? ' class=&quot;current&quot;' : '' ) . '&gt;' . __('Unattached') . '&lt;/a&gt;';
+$type_links[] = '&lt;li&gt;&lt;a href=&quot;upload.php?status=trash&quot;' . ( (isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' ) ? ' class=&quot;current&quot;' : '') . '&gt;' . sprintf( _nx( 'Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '&lt;/a&gt;';
</ins><span class="cx"> 
</span><span class="cx"> echo implode( &quot; |&lt;/li&gt;\n&quot;, $type_links) . '&lt;/li&gt;';
</span><span class="cx"> unset($type_links);
</span><span class="lines">@@ -242,8 +273,12 @@
</span><span class="cx"> &lt;div class=&quot;alignleft actions&quot;&gt;
</span><span class="cx"> &lt;select name=&quot;action&quot; class=&quot;select-action&quot;&gt;
</span><span class="cx"> &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
-&lt;?php if ( isset($orphans) ) { ?&gt;
</del><ins>+&lt;?php if ( $is_trash ) { ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
+&lt;?php } else { ?&gt;
+&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
+&lt;?php } if ( isset($orphans) ) { ?&gt;
</ins><span class="cx"> &lt;option value=&quot;attach&quot;&gt;&lt;?php _e('Attach to a post'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><span class="lines">@@ -251,7 +286,7 @@
</span><span class="cx"> &lt;?php wp_nonce_field('bulk-media'); ?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><del>-if ( ! is_singular() &amp;&amp; ! isset($_GET['detached']) ) {
</del><ins>+if ( !is_singular() &amp;&amp; !isset($_GET['detached']) &amp;&amp; !$is_trash ) {
</ins><span class="cx">         $arc_query = &quot;SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb-&gt;posts WHERE post_type = 'attachment' ORDER BY post_date DESC&quot;;
</span><span class="cx"> 
</span><span class="cx">         $arc_result = $wpdb-&gt;get_results( $arc_query );
</span><span class="lines">@@ -286,6 +321,8 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php if ( isset($_GET['detached']) ) { ?&gt;
</span><span class="cx">         &lt;input type=&quot;submit&quot; id=&quot;find_detached&quot; name=&quot;find_detached&quot; value=&quot;&lt;?php esc_attr_e('Scan for lost attachments'); ?&gt;&quot; class=&quot;button-secondary&quot; /&gt;
</span><ins>+&lt;?php } elseif ( isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' ) { ?&gt;
+        &lt;input type=&quot;submit&quot; id=&quot;delete_all&quot; name=&quot;delete_all&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"> 
</span><span class="cx"> &lt;/div&gt;
</span><span class="lines">@@ -341,7 +378,7 @@
</span><span class="cx">                 if ( current_user_can('edit_post', $post-&gt;ID) )
</span><span class="cx">                         $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
</span><span class="cx">                 if ( current_user_can('delete_post', $post-&gt;ID) )
</span><del>-                        $actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . esc_js(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
</del><ins>+                        $actions['trash'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=trash&amp;amp;post=$post-&gt;ID&quot;, 'trash-post_' . $post-&gt;ID) . &quot;'&gt;&quot; . __('Trash') . &quot;&lt;/a&gt;&quot;;
</ins><span class="cx">                 $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
</span><span class="cx">                 if ( current_user_can('edit_post', $post-&gt;ID) )
</span><span class="cx">                         $actions['attach'] = '&lt;a href=&quot;#the-list&quot; onclick=&quot;findPosts.open(\'media[]\',\''.$post-&gt;ID.'\');return false;&quot;&gt;'.__('Attach').'&lt;/a&gt;';
</span><span class="lines">@@ -398,12 +435,20 @@
</span><span class="cx"> &lt;div class=&quot;alignleft actions&quot;&gt;
</span><span class="cx"> &lt;select name=&quot;action2&quot; class=&quot;select-action&quot;&gt;
</span><span class="cx"> &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
</span><del>-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
-&lt;?php if ( isset($orphans) ) { ?&gt;
</del><ins>+&lt;?php if ($is_trash) { ?&gt;
+&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
+&lt;?php } else { ?&gt;
+&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
+&lt;?php } if (isset($orphans)) { ?&gt;
</ins><span class="cx"> &lt;option value=&quot;attach&quot;&gt;&lt;?php _e('Attach to a post'); ?&gt;&lt;/option&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
</span><ins>+
+&lt;?php if ( isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' ) { ?&gt;
+        &lt;input type=&quot;submit&quot; id=&quot;delete_all2&quot; name=&quot;delete_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } ?&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadminwpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/wp-admin.css (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/wp-admin.css        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-admin/wp-admin.css        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -409,7 +409,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #doaction,
</span><del>-#doaction2 {
</del><ins>+#doaction2,
+#post-query-submit {
</ins><span class="cx">         margin-right: 8px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -444,7 +445,9 @@
</span><span class="cx">         display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.unapproved .approve, .spam .approve, .deleted .approve {
</del><ins>+.unapproved .approve,
+.spam .approve,
+.trash .approve {
</ins><span class="cx">         display: inline;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpappphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-app.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-app.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-app.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -1231,7 +1231,7 @@
</span><span class="cx">                 log_app('Status','204: No Content');
</span><span class="cx">                 header('Content-Type: text/plain');
</span><span class="cx">                 status_header('204');
</span><del>-                echo &quot;Deleted.&quot;;
</del><ins>+                echo &quot;Moved to Trash.&quot;;
</ins><span class="cx">                 exit;
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludescommentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/comment.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/comment.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-includes/comment.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -208,8 +208,8 @@
</span><span class="cx">                 $approved = &quot;comment_approved = '1'&quot;;
</span><span class="cx">         elseif ( 'spam' == $status )
</span><span class="cx">                 $approved = &quot;comment_approved = 'spam'&quot;;
</span><del>-        elseif ( 'deleted' == $status )
-                $approved = &quot;comment_approved = 'deleted'&quot;;
</del><ins>+        elseif ( 'trash' == $status )
+                $approved = &quot;comment_approved = 'trash'&quot;;
</ins><span class="cx">         else
</span><span class="cx">                 $approved = &quot;( comment_approved = '0' OR comment_approved = '1' )&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -694,14 +694,15 @@
</span><span class="cx">         if ( false !== $count )
</span><span class="cx">                 return $count;
</span><span class="cx"> 
</span><del>-        $where = '';
</del><ins>+        $where = 'WHERE ';
</ins><span class="cx">         if( $post_id &gt; 0 )
</span><del>-                $where = $wpdb-&gt;prepare( &quot;WHERE comment_post_ID = %d&quot;, $post_id );
</del><ins>+                $where .= $wpdb-&gt;prepare( &quot;c.comment_post_ID = %d AND &quot;, $post_id );
+        $where .= &quot;p.post_status &lt;&gt; 'trash'&quot;;
</ins><span class="cx"> 
</span><del>-        $count = $wpdb-&gt;get_results( &quot;SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb-&gt;comments} {$where} GROUP BY comment_approved&quot;, ARRAY_A );
</del><ins>+        $count = $wpdb-&gt;get_results( &quot;SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb-&gt;comments} c LEFT JOIN {$wpdb-&gt;posts} p ON c.comment_post_ID = p.ID {$where} GROUP BY comment_approved&quot;, ARRAY_A );
</ins><span class="cx"> 
</span><span class="cx">         $total = 0;
</span><del>-        $approved = array('0' =&gt; 'moderated', '1' =&gt; 'approved', 'spam' =&gt; 'spam', 'deleted' =&gt; 'deleted');
</del><ins>+        $approved = array('0' =&gt; 'moderated', '1' =&gt; 'approved', 'spam' =&gt; 'spam', 'trash' =&gt; 'trash');
</ins><span class="cx">         $known_types = array_keys( $approved );
</span><span class="cx">         foreach( (array) $count as $row_num =&gt; $row ) {
</span><span class="cx">                 $total += $row['num_comments'];
</span><span class="lines">@@ -737,16 +738,21 @@
</span><span class="cx">  * @return bool False if delete comment query failure, true on success.
</span><span class="cx">  */
</span><span class="cx"> function wp_delete_comment($comment_id) {
</span><del>-        if (wp_get_comment_status($comment_id) != 'deleted' &amp;&amp; wp_get_comment_status($comment_id) != 'spam')
-                return wp_set_comment_status($comment_id, 'delete');
</del><ins>+        global $wpdb;
+        if (!$comment = get_comment($comment_id))
+                return false;
+
+        if (wp_get_comment_status($comment_id) != 'trash' &amp;&amp; wp_get_comment_status($comment_id) != 'spam' &amp;&amp; EMPTY_TRASH_DAYS &gt; 0)
+                return wp_trash_comment($comment_id);
</ins><span class="cx">         
</span><del>-        global $wpdb;
</del><span class="cx">         do_action('delete_comment', $comment_id);
</span><span class="cx">         
</span><del>-        wp_unschedule_comment_delete($comment_id);
</del><ins>+        $trash_meta = get_option('wp_trash_meta');
+        if (is_array($trash_meta) &amp;&amp; isset($trash_meta['comments'][$comment_id])) {
+                unset($trash_meta['comments'][$comment_id]);
+                update_option('wp_trash_meta', $trash_meta);
+        }
</ins><span class="cx"> 
</span><del>-        $comment = get_comment($comment_id);
-
</del><span class="cx">         if ( ! $wpdb-&gt;query( $wpdb-&gt;prepare(&quot;DELETE FROM $wpdb-&gt;comments WHERE comment_ID = %d LIMIT 1&quot;, $comment_id) ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="lines">@@ -769,12 +775,72 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Moves a comment to the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'trash_comment' before trashing
+ * @uses do_action() on 'trashed_comment' after trashing
+ *
+ * @param int $comment_id Comment ID.
+ * @return mixed False on failure
+ */
+function wp_trash_comment($comment_id = 0) {
+        if (EMPTY_TRASH_DAYS == 0)
+                return wp_delete_comment($comment_id);
+
+        if (!$comment = get_comment($comment_id))
+                return false;
+
+        do_action('trash_comment', $comment_id);
+
+        $trash_meta = get_option('wp_trash_meta', array());
+        $trash_meta['comments'][$comment_id]['status'] = $comment-&gt;comment_approved;
+        $trash_meta['comments'][$comment_id]['time'] = time();
+        update_option('wp_trash_meta', $trash_meta);
+
+        wp_set_comment_status($comment_id, 'trash');
+
+        do_action('trashed_comment', $comment_id);
+
+        return true;
+}
+
+/**
+ * Removes a comment from the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'untrash_comment' before undeletion
+ * @uses do_action() on 'untrashed_comment' after undeletion
+ *
+ * @param int $comment_id Comment ID.
+ * @return mixed False on failure
+ */
+function wp_untrash_comment($comment_id = 0) {
+        do_action('untrash_comment', $comment_id);
+
+        $comment = array('comment_ID'=&gt;$comment_id, 'comment_approved'=&gt;'0');
+
+        $trash_meta = get_option('wp_trash_meta');
+        if (is_array($trash_meta) &amp;&amp; isset($trash_meta['comments'][$comment_id])) {
+                $comment['comment_approved'] = $trash_meta['comments'][$comment_id]['status'];
+                unset($trash_meta['comments'][$comment_id]);
+                update_option('wp_trash_meta', $trash_meta);
+        }
+
+        wp_update_comment($comment);
+
+        do_action('untrashed_comment', $comment_id);
+
+        return true;
+}
+
+/**
</ins><span class="cx">  * The status of a comment by ID.
</span><span class="cx">  *
</span><span class="cx">  * @since 1.0.0
</span><span class="cx">  *
</span><span class="cx">  * @param int $comment_id Comment ID
</span><del>- * @return string|bool Status might be 'deleted', 'approved', 'unapproved', 'spam'. False on failure.
</del><ins>+ * @return string|bool Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
</ins><span class="cx">  */
</span><span class="cx"> function wp_get_comment_status($comment_id) {
</span><span class="cx">         $comment = get_comment($comment_id);
</span><span class="lines">@@ -784,15 +850,15 @@
</span><span class="cx">         $approved = $comment-&gt;comment_approved;
</span><span class="cx"> 
</span><span class="cx">         if ( $approved == NULL )
</span><del>-                return 'deleted';
</del><ins>+                return false;
</ins><span class="cx">         elseif ( $approved == '1' )
</span><span class="cx">                 return 'approved';
</span><span class="cx">         elseif ( $approved == '0' )
</span><span class="cx">                 return 'unapproved';
</span><span class="cx">         elseif ( $approved == 'spam' )
</span><span class="cx">                 return 'spam';
</span><del>-        elseif ( $approved == 'deleted' )
-                return 'deleted';
</del><ins>+        elseif ( $approved == 'trash' )
+                return 'trash';
</ins><span class="cx">         else
</span><span class="cx">                 return false;
</span><span class="cx"> }
</span><span class="lines">@@ -1037,8 +1103,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_delete($comment_id);
-        
</del><ins>+                
</ins><span class="cx">         $status = '0';
</span><span class="cx">         switch ( $comment_status ) {
</span><span class="cx">                 case 'hold':
</span><span class="lines">@@ -1054,11 +1119,8 @@
</span><span class="cx">                 case 'spam':
</span><span class="cx">                         $status = 'spam';
</span><span class="cx">                         break;
</span><del>-                case 'delete':
-                        if (wp_get_comment_status($comment_id) == 'deleted' || wp_get_comment_status($comment_id) == 'spam')
-                                return wp_delete_comment($comment_id);
-                        $status = 'deleted';
-                        wp_schedule_comment_delete($comment_id);
</del><ins>+                case 'trash':
+                        $status = 'trash';
</ins><span class="cx">                         break;
</span><span class="cx">                 default:
</span><span class="cx">                         return false;
</span><span class="lines">@@ -1084,42 +1146,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Schedules a comment for destruction in 30 days.
- * 
- * @since 2.9.0
- * 
- * @param int $comment_id Comment ID.
- * @return void
- */
-function wp_schedule_comment_delete($comment_id) {
-        $to_delete = get_option('wp_scheduled_delete');
-        if ( !is_array($to_delete) )
-                $to_delete = array();
-        
-        $to_delete['comments'][$comment_id] = time();
-        
-        update_option('wp_scheduled_delete', $to_delete);
-}
-
-/**
- * Unschedules a comment for destruction.
- * 
- * @since 2.9.0
- * 
- * @param int $comment_id Comment ID.
- * @return void
- */
-function wp_unschedule_comment_delete($comment_id) {
-        $to_delete = get_option('wp_scheduled_delete');
-        if ( !is_array($to_delete) )
-                return;
-        
-        unset($to_delete['comments'][$comment_id]);
-        
-        update_option('wp_scheduled_delete', $to_delete);
-}
-
-/**
</del><span class="cx">  * Updates an existing comment in the database.
</span><span class="cx">  *
</span><span class="cx">  * Filters the comment and makes sure certain fields are valid before updating.
</span></span></pre></div>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-includes/functions.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -3339,30 +3339,31 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Permanently deletes comments that have been scheduled for deleting.
- * Will do the same for posts, pages, etc in the future.
</del><ins>+ * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS.
</ins><span class="cx">  * 
</span><del>- * @access private
</del><span class="cx">  * @since 2.9.0
</span><span class="cx">  *
</span><span class="cx">  * @return void
</span><span class="cx">  */
</span><span class="cx"> function wp_scheduled_delete() {
</span><del>-        $to_delete = get_option('wp_scheduled_delete');
-        if (!is_array($to_delete))
</del><ins>+        $trash_meta = get_option('wp_trash_meta');
+        if ( !is_array($trash_meta) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-        if ( !isset($to_delete['comments']) || !is_array($to_delete['comments']) )
-                $to_delete['comments'] = array();
</del><ins>+        $delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS);
</ins><span class="cx"> 
</span><del>-        $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]);
</del><ins>+        foreach ( $trash_meta['comments'] as $id =&gt; $meta ) {
+                if ( $meta['time'] &lt; $delete_timestamp ) {
+                        wp_delete_comment($id);
+                        unset($trash_meta['comments'][$id]);
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><ins>+        foreach ( $trash_meta['posts'] as $id =&gt; $meta ) {
+                if ( $meta['time'] &lt; $delete_timestamp ) {
+                        wp_delete_post($id);
+                        unset($to_delete['posts'][$id]);
+                }
+        }
</ins><span class="cx"> 
</span><span class="cx">         update_option('wp_scheduled_delete', $to_delete);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-includes/post.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -998,7 +998,7 @@
</span><span class="cx"> 
</span><span class="cx">         $count = $wpdb-&gt;get_results( $wpdb-&gt;prepare( $query, $type ), ARRAY_A );
</span><span class="cx"> 
</span><del>-        $stats = array( 'publish' =&gt; 0, 'private' =&gt; 0, 'draft' =&gt; 0, 'pending' =&gt; 0, 'future' =&gt; 0 );
</del><ins>+        $stats = array( 'publish' =&gt; 0, 'private' =&gt; 0, 'draft' =&gt; 0, 'pending' =&gt; 0, 'future' =&gt; 0, 'trash' =&gt; 0 );
</ins><span class="cx">         foreach( (array) $count as $row_num =&gt; $row ) {
</span><span class="cx">                 $stats[$row['post_status']] = $row['num_posts'];
</span><span class="cx">         }
</span><span class="lines">@@ -1027,12 +1027,13 @@
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><span class="cx">         $and = wp_post_mime_type_where( $mime_type );
</span><del>-        $count = $wpdb-&gt;get_results( &quot;SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb-&gt;posts WHERE post_type = 'attachment' $and GROUP BY post_mime_type&quot;, ARRAY_A );
</del><ins>+        $count = $wpdb-&gt;get_results( &quot;SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type&quot;, ARRAY_A );
</ins><span class="cx"> 
</span><span class="cx">         $stats = array( );
</span><span class="cx">         foreach( (array) $count as $row ) {
</span><span class="cx">                 $stats[$row['post_mime_type']] = $row['num_posts'];
</span><span class="cx">         }
</span><ins>+        $stats['trash'] = $wpdb-&gt;get_var( &quot;SELECT COUNT( * ) FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND post_status = 'trash' $and&quot;);
</ins><span class="cx"> 
</span><span class="cx">         return (object) $stats;
</span><span class="cx"> }
</span><span class="lines">@@ -1140,10 +1141,19 @@
</span><span class="cx">         if ( !$post = $wpdb-&gt;get_row($wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;posts WHERE ID = %d&quot;, $postid)) )
</span><span class="cx">                 return $post;
</span><span class="cx"> 
</span><del>-        if ( 'attachment' == $post-&gt;post_type )
</del><ins>+        if ( ($post-&gt;post_type == 'post' || $post-&gt;post_type == 'page') &amp;&amp; get_post_status($postid) != 'trash' &amp;&amp; EMPTY_TRASH_DAYS &gt; 0 )
+                return wp_trash_post($postid);
+                
+        if ( $post-&gt;post_type == 'attachment' )
</ins><span class="cx">                 return wp_delete_attachment($postid);
</span><span class="cx"> 
</span><span class="cx">         do_action('delete_post', $postid);
</span><ins>+        
+        $trash_meta = get_option('wp_trash_meta');
+        if ( is_array($trash_meta) &amp;&amp; isset($trash_meta['posts'][$postid]) ) {
+                unset($trash_meta['posts'][$postid]);
+                update_option('wp_trash_meta', $trash_meta);
+        }
</ins><span class="cx"> 
</span><span class="cx">         /** @todo delete for pluggable post taxonomies too */
</span><span class="cx">         wp_delete_object_term_relationships($postid, array('category', 'post_tag'));
</span><span class="lines">@@ -1205,6 +1215,72 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Moves a post or page to the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'trash_post' before trashing
+ * @uses do_action() on 'trashed_post' after trashing
+ *
+ * @param int $postid Post ID.
+ * @return mixed False on failure
+ */
+function wp_trash_post($postid = 0) {
+        if ( EMPTY_TRASH_DAYS == 0 )
+                return wp_delete_post($postid);
+
+        if ( !$post = wp_get_single_post($postid, ARRAY_A) )
+                return $post;
+
+        do_action('trash_post', $postid);
+
+        $trash_meta = get_option('wp_trash_meta');
+        if ( !is_array($trash_meta) )
+                $trash_meta = array();
+        $trash_meta['posts'][$postid]['status'] = $post['post_status'];
+        $trash_meta['posts'][$postid]['time'] = time();
+        update_option('wp_trash_meta', $trash_meta);
+
+        $post['post_status'] = 'trash';
+        wp_insert_post($post);
+
+        do_action('trashed_post', $postid);
+
+        return $post;
+}
+
+/**
+ * Removes a post or page from the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'untrash_post' before undeletion
+ * @uses do_action() on 'untrashed_post' after undeletion
+ *
+ * @param int $postid Post ID.
+ * @return mixed False on failure
+ */
+function wp_untrash_post($postid = 0) {
+        if (!$post = wp_get_single_post($postid, ARRAY_A))
+                return $post;
+
+        do_action('untrash_post', $postid);
+        
+        $post['post_status'] = 'draft';
+        
+        $trash_meta = get_option('wp_trash_meta');
+        if (is_array($trash_meta) &amp;&amp; isset($trash_meta['posts'][$postid])) {
+                $post['post_status'] = $trash_meta['posts'][$postid]['status'];
+                unset($trash_meta['posts'][$postid]);
+                update_option('wp_trash_meta', $trash_meta);
+        }
+        
+        wp_insert_post($post);
+        
+        do_action('untrashed_post', $postid);
+
+        return $post;
+}
+
+/**
</ins><span class="cx">  * Retrieve the list of categories for a post.
</span><span class="cx">  *
</span><span class="cx">  * Compatibility layer for themes and plugins. Also an easy layer of abstraction
</span><span class="lines">@@ -2586,7 +2662,16 @@
</span><span class="cx"> 
</span><span class="cx">         if ( 'attachment' != $post-&gt;post_type )
</span><span class="cx">                 return false;
</span><ins>+        
+        if ( 'trash' != $post-&gt;post_status )
+                return wp_trash_post($postid);
</ins><span class="cx"> 
</span><ins>+        $trash_meta = get_option('wp_trash_meta');
+        if ( is_array($trash_meta) &amp;&amp; isset($trash_meta['posts'][$postid]) ) {
+                unset($trash_meta['posts'][$postid]);
+                update_option('wp_trash_meta', $trash_meta);
+        }
+
</ins><span class="cx">         $meta = wp_get_attachment_metadata( $postid );
</span><span class="cx">         $file = get_attached_file( $postid );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesqueryphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/query.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/query.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-includes/query.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -2099,6 +2099,8 @@
</span><span class="cx">                                 $p_status[] = &quot;$wpdb-&gt;posts.post_status = 'private'&quot;;
</span><span class="cx">                         if ( in_array( 'publish', $q_status ) )
</span><span class="cx">                                 $r_status[] = &quot;$wpdb-&gt;posts.post_status = 'publish'&quot;;
</span><ins>+                        if ( in_array( 'trash', $q_status ) )
+                                $r_status[] = &quot;$wpdb-&gt;posts.post_status = 'trash'&quot;;
</ins><span class="cx"> 
</span><span class="cx">                         if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {
</span><span class="cx">                                 $r_status = array_merge($r_status, $p_status);
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-includes/script-loader.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'utils', &quot;/wp-admin/js/utils$suffix.js&quot;, false, '20090102' );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'common', &quot;/wp-admin/js/common$suffix.js&quot;, array('jquery', 'hoverIntent', 'utils'), '20090720' );
</del><ins>+        $scripts-&gt;add( 'common', &quot;/wp-admin/js/common$suffix.js&quot;, array('jquery', 'hoverIntent', 'utils'), '20090730' );
</ins><span class="cx">         $scripts-&gt;add_data( 'common', 'group', 1 );
</span><span class="cx">         $scripts-&gt;localize( 'common', 'commonL10n', array(
</span><span class="cx">                 'warnDelete' =&gt; __(&quot;You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete.&quot;),
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">                         'upload_stopped' =&gt; __('Upload stopped.'),
</span><span class="cx">                         'dismiss' =&gt; __('Dismiss'),
</span><span class="cx">                         'crunching' =&gt; __('Crunching&amp;hellip;'),
</span><del>-                        'deleted' =&gt; __('Deleted'),
</del><ins>+                        'deleted' =&gt; __('Moved to Trash'),
</ins><span class="cx">                         'l10n_print_after' =&gt; 'try{convertEntities(swfuploadL10n);}catch(e){};'
</span><span class="cx">         ) );
</span><span class="cx"> 
</span><span class="lines">@@ -248,7 +248,7 @@
</span><span class="cx">                 $scripts-&gt;add( 'user-profile', &quot;/wp-admin/js/user-profile$suffix.js&quot;, array('jquery'), '20090514' );
</span><span class="cx">                 $scripts-&gt;add_data( 'user-profile', 'group', 1 );
</span><span class="cx"> 
</span><del>-                $scripts-&gt;add( 'admin-comments', &quot;/wp-admin/js/edit-comments$suffix.js&quot;, array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090720' );
</del><ins>+                $scripts-&gt;add( 'admin-comments', &quot;/wp-admin/js/edit-comments$suffix.js&quot;, array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090730' );
</ins><span class="cx">                 $scripts-&gt;add_data( 'admin-comments', 'group', 1 );
</span><span class="cx">                 $scripts-&gt;localize( 'admin-comments', 'adminCommentsL10n', array(
</span><span class="cx">                         'hotkeys_highlight_first' =&gt; isset($_GET['hotkeys_highlight_first']),
</span></span></pre></div>
<a id="trunkwpsettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-settings.php (11748 => 11749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-settings.php        2009-07-27 23:28:13 UTC (rev 11748)
+++ trunk/wp-settings.php        2009-07-30 13:39:34 UTC (rev 11749)
</span><span class="lines">@@ -534,6 +534,12 @@
</span><span class="cx"> if ( !defined( 'AUTOSAVE_INTERVAL' ) )
</span><span class="cx">         define( 'AUTOSAVE_INTERVAL', 60 );
</span><span class="cx"> 
</span><ins>+/**
+ * It is possible to define this in wp-config.php
+ * @since 2.9.0
+ */
+if ( !defined( 'EMPTY_TRASH_DAYS' ) )
+        define( 'EMPTY_TRASH_DAYS', 30 );
</ins><span class="cx"> 
</span><span class="cx"> require (ABSPATH . WPINC . '/vars.php');
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>