<!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>[11841] trunk: &quot;Trash&quot; updates, props caesarsgrunt, see #4529</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/11841">11841</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-08-19 08:35:24 +0000 (Wed, 19 Aug 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>&quot;Trash&quot; updates, 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="#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="#trunkwpadmineditformcommentphp">trunk/wp-admin/edit-form-comment.php</a></li>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminuploadphp">trunk/wp-admin/upload.php</a></li>
<li><a href="#trunkwpincludescapabilitiesphp">trunk/wp-includes/capabilities.php</a></li>
<li><a href="#trunkwpincludesjsswfuploadhandlersdevjs">trunk/wp-includes/js/swfupload/handlers.dev.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadhandlersjs">trunk/wp-includes/js/swfupload/handlers.js</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.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 (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-admin/admin-ajax.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -312,6 +312,19 @@
</span><span class="cx">         else
</span><span class="cx">                 die('0');
</span><span class="cx">         break;
</span><ins>+case 'trash-post' :
+        check_ajax_referer( &quot;{$action}_$id&quot; );
+        if ( !current_user_can( 'delete_post', $id ) )
+                die('-1');
+
+        if ( !get_post( $id ) )
+                die('1');
+
+        if ( wp_trash_post( $id ) )
+                die('1');
+        else
+                die('0');
+        break;
</ins><span class="cx"> case 'delete-page' :
</span><span class="cx">         check_ajax_referer( &quot;{$action}_$id&quot; );
</span><span class="cx">         if ( !current_user_can( 'delete_page', $id ) )
</span></span></pre></div>
<a id="trunkwpadmineditattachmentrowsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-attachment-rows.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-attachment-rows.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-admin/edit-attachment-rows.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> 
</span><span class="cx">         case 'cb':
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;media[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;/th&gt;
</del><ins>+                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( current_user_can('edit_post', $post-&gt;ID) ) { ?&gt;&lt;input type=&quot;checkbox&quot; name=&quot;media[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;?php } ?&gt;&lt;/th&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="lines">@@ -89,9 +89,11 @@
</span><span class="cx">                 &lt;p&gt;
</span><span class="cx">                 &lt;?php
</span><span class="cx">                 $actions = array();
</span><del>-                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;;
</del><ins>+                if ( $is_trash ) {
+                        if ( 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;;
+                        }
</ins><span class="cx">                 } else {
</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></pre></div>
<a id="trunkwpadmineditcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-comments.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-comments.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-admin/edit-comments.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx"> 
</span><span class="cx"> if ( ( 'spam' == $comment_status || 'trash' == $comment_status) &amp;&amp; current_user_can ('moderate_comments') ) {
</span><span class="cx">         wp_nonce_field('bulk-destroy', '_destroy_nonce');
</span><del>-    if ( 'spam' == $comment_status ) { ?&gt;
</del><ins>+    if ( 'spam' == $comment_status &amp;&amp; current_user_can('moderate_comments') ) { ?&gt;
</ins><span class="cx">                 &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;
</span><span class="cx"> &lt;?php } elseif ( 'trash' == $comment_status &amp;&amp; current_user_can('moderate_comments') ) { ?&gt;
</span><span class="cx">                 &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;
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( 'spam' == $comment_status ) { ?&gt;
</del><ins>+&lt;?php if ( 'spam' == $comment_status &amp;&amp; current_user_can('moderate_comments') ) { ?&gt;
</ins><span class="cx"> &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;
</span><span class="cx"> &lt;?php } elseif ( 'trash' == $comment_status &amp;&amp; current_user_can('moderate_comments') ) { ?&gt;
</span><span class="cx"> &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;
</span></span></pre></div>
<a id="trunkwpadmineditformcommentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-comment.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-comment.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-admin/edit-form-comment.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -68,7 +68,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;'&gt;&quot; . __('Move to Trash') . &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=trashcomment&amp;amp;c=$comment-&gt;comment_ID&amp;amp;_wp_original_http_referer=&quot; . urlencode(wp_get_referer()), 'trash-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="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-admin/includes/media.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -1062,9 +1062,12 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $output = '';
</span><del>-        foreach ( (array) $attachments as $id =&gt; $attachment )
</del><ins>+        foreach ( (array) $attachments as $id =&gt; $attachment ) {
+                if ( $attachment-&gt;post_status == 'trash' )
+                        continue;
</ins><span class="cx">                 if ( $item = get_media_item( $id, array( 'errors' =&gt; isset($errors[$id]) ? $errors[$id] : null) ) )
</span><span class="cx">                         $output .= &quot;\n&lt;div id='media-item-$id' class='media-item child-of-$attachment-&gt;post_parent preloaded'&gt;&lt;div class='progress'&gt;&lt;div class='bar'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id='media-upload-error-$id'&gt;&lt;/div&gt;&lt;div class='filename'&gt;&lt;/div&gt;$item\n&lt;/div&gt;&quot;;
</span><ins>+        }
</ins><span class="cx"> 
</span><span class="cx">         return $output;
</span><span class="cx"> }
</span><span class="lines">@@ -1166,11 +1169,11 @@
</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=trash&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;, 'trash-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;$delete_href\&quot; id=\&quot;del[$attachment_id]\&quot; class=\&quot;delete\&quot;&gt;&quot; . __('Move to Trash') . &quot;&lt;/a&gt;&quot;;
</del><ins>+                $delete = current_user_can('delete_post', $attachment_id) ? &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; : &quot;&quot;;
</ins><span class="cx">         if ( ( $send || $delete ) &amp;&amp; !isset($form_fields['buttons']) )
</span><span class="cx">                 $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;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-admin/includes/template.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -1439,9 +1439,11 @@
</span><span class="cx">                                 the_excerpt();
</span><span class="cx"> 
</span><span class="cx">                         $actions = array();
</span><del>-                        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;;
</del><ins>+                        if ('trash' == $post-&gt;post_status) {
+                                if ( current_user_can('delete_post', $post-&gt;ID) ) {
+                                        $actions['untrash'] = &quot;&lt;a title='&quot; . esc_attr(__('Restore 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><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; title=&quot;' . esc_attr(__('Edit this post')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
</span></span></pre></div>
<a id="trunkwpadminuploadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/upload.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/upload.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-admin/upload.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -321,7 +321,7 @@
</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><del>-&lt;?php } elseif ( isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' ) { ?&gt;
</del><ins>+&lt;?php } elseif ( isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' &amp;&amp; current_user_can('edit_others_posts') ) { ?&gt;
</ins><span class="cx">         &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;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -362,7 +362,7 @@
</span><span class="cx">                         $att_title = esc_html( _draft_or_post_title($post-&gt;ID) );
</span><span class="cx"> ?&gt;
</span><span class="cx">         &lt;tr id='post-&lt;?php echo $post-&gt;ID; ?&gt;' class='&lt;?php echo $class; ?&gt;' valign=&quot;top&quot;&gt;
</span><del>-                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;media[]&quot; value=&quot;&lt;?php echo esc_attr($post-&gt;ID); ?&gt;&quot; /&gt;&lt;/th&gt;
</del><ins>+                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( current_user_can('edit_post', $post-&gt;ID) ) { ?&gt;&lt;input type=&quot;checkbox&quot; name=&quot;media[]&quot; value=&quot;&lt;?php echo esc_attr($post-&gt;ID); ?&gt;&quot; /&gt;&lt;?php } ?&gt;&lt;/th&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;td class=&quot;media-icon&quot;&gt;&lt;?php
</span><span class="cx">                 if ( $thumb = wp_get_attachment_image( $post-&gt;ID, array(80, 60), true ) ) { ?&gt;
</span><span class="lines">@@ -446,7 +446,7 @@
</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><span class="cx"> 
</span><del>-&lt;?php if ( isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' ) { ?&gt;
</del><ins>+&lt;?php if ( isset($_GET['status']) &amp;&amp; $_GET['status'] == 'trash' &amp;&amp; current_user_can('edit_others_posts') ) { ?&gt;
</ins><span class="cx">         &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;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span></span></pre></div>
<a id="trunkwpincludescapabilitiesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/capabilities.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/capabilities.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-includes/capabilities.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -827,11 +827,16 @@
</span><span class="cx">                 // If the user is the author...
</span><span class="cx">                 if ( $user_id == $post_author_data-&gt;ID ) {
</span><span class="cx">                         // If the post is published...
</span><del>-                        if ( 'publish' == $post-&gt;post_status )
</del><ins>+                        if ( 'publish' == $post-&gt;post_status ) {
</ins><span class="cx">                                 $caps[] = 'edit_published_posts';
</span><del>-                        else
</del><ins>+                        } elseif ( 'trash' == $post-&gt;post_status ) {
+                                $trash_meta = get_option('wp_trash_meta');
+                                if ( is_array($trash_meta) &amp;&amp; isset($trash_meta['posts'][$post-&gt;ID]['status']) &amp;&amp; $trash_meta['posts'][$post-&gt;ID]['status'] == 'publish' )
+                                        $caps[] = 'edit_published_posts';
+                        } else {
</ins><span class="cx">                                 // If the post is draft...
</span><span class="cx">                                 $caps[] = 'edit_posts';
</span><ins>+                        }
</ins><span class="cx">                 } else {
</span><span class="cx">                         // The user is trying to edit someone else's post.
</span><span class="cx">                         $caps[] = 'edit_others_posts';
</span><span class="lines">@@ -851,11 +856,16 @@
</span><span class="cx">                 // If the user is the author...
</span><span class="cx">                 if ( $user_id == $page_author_data-&gt;ID ) {
</span><span class="cx">                         // If the page is published...
</span><del>-                        if ( 'publish' == $page-&gt;post_status )
</del><ins>+                        if ( 'publish' == $page-&gt;post_status ) {
</ins><span class="cx">                                 $caps[] = 'edit_published_pages';
</span><del>-                        else
</del><ins>+                        } elseif ( 'trash' == $page-&gt;post_status ) {
+                                $trash_meta = get_option('wp_trash_meta');
+                                if ( is_array($trash_meta) &amp;&amp; isset($trash_meta['posts'][$page-&gt;ID]['status']) &amp;&amp; $trash_meta['posts'][$page-&gt;ID]['status'] == 'publish' )
+                                        $caps[] = 'edit_published_pages';
+                        } else {
</ins><span class="cx">                                 // If the page is draft...
</span><span class="cx">                                 $caps[] = 'edit_pages';
</span><ins>+                        }
</ins><span class="cx">                 } else {
</span><span class="cx">                         // The user is trying to edit someone else's page.
</span><span class="cx">                         $caps[] = 'edit_others_pages';
</span></span></pre></div>
<a id="trunkwpincludesjsswfuploadhandlersdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/swfupload/handlers.dev.js (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/handlers.dev.js        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-includes/js/swfupload/handlers.dev.js        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">                 // Tell the server to delete it. TODO: handle exceptions
</span><span class="cx">                 jQuery.ajax({url:'admin-ajax.php',type:'post',success:deleteSuccess,error:deleteError,id:fileObj.id,data:{
</span><span class="cx">                         id : this.id.replace(/[^0-9]/g,''),
</span><del>-                        action : 'delete-post',
</del><ins>+                        action : 'trash-post',
</ins><span class="cx">                         _ajax_nonce : this.href.replace(/^.*wpnonce=/,'')}
</span><span class="cx">                         });
</span><span class="cx">                 return false;
</span></span></pre></div>
<a id="trunkwpincludesjsswfuploadhandlersjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/swfupload/handlers.js (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/handlers.js        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-includes/js/swfupload/handlers.js        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -1 +1 @@
</span><del>-function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}function fileQueued(a){jQuery(&quot;.media-blank&quot;).remove();if(jQuery(&quot;.type-form #media-items&gt;*&quot;).length==1&amp;&amp;jQuery(&quot;#media-items .hidden&quot;).length&gt;0){jQuery(&quot;.describe-toggle-on&quot;).show();jQuery(&quot;.describe-toggle-off&quot;).hide();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+a.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; '+a.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;#media-item-&quot;+a.id+&quot; .progress&quot;).show();jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}function uploadStart(a){return true}function uploadProgress(d,b,c){var a=jQuery(&quot;#media-items&quot;).width()-2;jQuery(&quot;#media-item-&quot;+d.id+&quot; .bar&quot;).width(a*b/c);jQuery(&quot;#media-item-&quot;+d.id+&quot; .percent&quot;).html(Math.ceil(b/c*100)+&quot;%&quot;);if(b==c){jQuery(&quot;#media-item-&quot;+d.id+&quot; .bar&quot;).html('&lt;strong class=&quot;crunching&quot;&gt;'+swfuploadL10n.crunching+&quot;&lt;/strong&gt;&quot;)}}function prepareMediaItem(b,a){jQuery(&quot;#media-item-&quot;+b.id+&quot; .bar&quot;).remove();jQuery(&quot;#media-item-&quot;+b.id+&quot; .progress&quot;).hide();var c=(typeof shortform==&quot;undefined&quot;)?1:2;if(isNaN(a)||!a){jQuery(&quot;#media-item-&quot;+b.id).append(a);prepareMediaItemInit(b)}else{jQuery(&quot;#media-item-&quot;+b.id).load(&quot;async-upload.php&quot;,{attachment_id:a,fetch:c},function(){prepareMediaItemInit(b);updateMediaForm()})}}function prepareMediaItemInit(a){jQuery(&quot;#media-item-&quot;+a.id+&quot; .thumbnail&quot;).clone().attr(&quot;className&quot;,&quot;pinkynail toggle&quot;).prependTo(&quot;#media-item-&quot;+a.id);jQuery(&quot;#media-item-&quot;+a.id+&quot; .filename.original&quot;).replaceWith(jQuery(&quot;#media-item-&quot;+a.id+&quot; .filename.new&quot;));jQuery(&quot;#media-item-&quot;+a.id+&quot; a.toggle&quot;).click(function(){jQuery(this).siblings(&quot;.slidetoggle&quot;).slideToggle(150,function(){var b=jQuery(this).offset();window.scrollTo(0,b.top-36)});jQuery(this).parent().children(&quot;.toggle&quot;).toggle();jQuery(this).siblings(&quot;a.toggle&quot;).focus();return false});jQuery(&quot;#media-item-&quot;+a.id+&quot; a.delete&quot;).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,success:deleteSuccess,error:deleteError,id:a.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;delete-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)}});return false});jQuery(&quot;#media-item-&quot;+a.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).slideToggle(500).parent().children(&quot;.toggle&quot;).toggle()}function itemAjaxError(c,b){var a=jQuery(&quot;#media-item-error&quot;+c);a.html('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+c+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);jQuery(&quot;#dismiss-&quot;+c).click(function(){jQuery(this).parents(&quot;.file-error&quot;).slideUp(200,function(){jQuery(this).empty()})})}function deleteSuccess(b,c){if(b==&quot;-1&quot;){return itemAjaxError(this.id,&quot;You do not have permission. Has your session expired?&quot;)}if(b==&quot;0&quot;){return itemAjaxError(this.id,&quot;Could not be deleted. Has it been deleted already?&quot;)}var a=jQuery(&quot;#media-item-&quot;+this.id);if(type=jQuery(&quot;#type-of-&quot;+this.id).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-1)}if(a.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-1)}if(jQuery(&quot;.type-form #media-items&gt;*&quot;).length==1&amp;&amp;jQuery(&quot;#media-items .hidden&quot;).length&gt;0){jQuery(&quot;.toggle&quot;).toggle();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-item-&quot;+this.id+&quot; .filename:empty&quot;).remove();jQuery(&quot;#media-item-&quot;+this.id+&quot; .filename&quot;).append(' &lt;span class=&quot;file-error&quot;&gt;'+swfuploadL10n.deleted+&quot;&lt;/span&gt;&quot;).siblings(&quot;a.toggle&quot;).remove();jQuery(&quot;#media-item-&quot;+this.id).children(&quot;.describe&quot;).css({backgroundColor:&quot;#fff&quot;}).end().animate({backgroundColor:&quot;#ffc0c0&quot;},{queue:false,duration:50}).animate({minHeight:0,height:36},400,null,function(){jQuery(this).children(&quot;.describe&quot;).remove()}).animate({backgroundColor:&quot;#fff&quot;},400).animate({height:0},800,null,function(){jQuery(this).remove();updateMediaForm()});return}function deleteError(c,b,a){}function updateMediaForm(){storeState();if(jQuery(&quot;.type-form #media-items&gt;*&quot;).length==1){jQuery(&quot;#media-items .slidetoggle&quot;).slideDown(500).parent().eq(0).children(&quot;.toggle&quot;).toggle();jQuery(&quot;.type-form .slidetoggle&quot;).siblings().addClass(&quot;hidden&quot;)}if(jQuery(&quot;#media-items&gt;*&quot;).not(&quot;.media-blank&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}if(jQuery(&quot;#media-items&gt;*&quot;).length&gt;1){jQuery(&quot;.insert-gallery&quot;).show()}else{jQuery(&quot;.insert-gallery&quot;).hide()}}function uploadSuccess(b,a){if(a.match(&quot;media-upload-error&quot;)){jQuery(&quot;#media-item-&quot;+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery(&quot;#media-item-&quot;+b.id).hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)}function wpFileError(b,a){jQuery(&quot;#media-item-&quot;+b.id+&quot; .filename&quot;).after('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+b.id+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+a+&quot;&lt;/div&gt;&quot;).siblings(&quot;.toggle&quot;).remove();jQuery(&quot;#dismiss-&quot;+b.id).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(b){try{if(b&gt;0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display=&quot;block&quot;;a.style.display=&quot;none&quot;}else{c.style.display=&quot;none&quot;;a.style.display=&quot;block&quot;}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery(&quot;#media-item-&quot;+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}var storeState;(function(a){storeState=function(){var c=getUserSetting(&quot;align&quot;)||&quot;&quot;,b=getUserSetting(&quot;imgsize&quot;)||&quot;&quot;;a('tr.align input[type=&quot;radio&quot;]').click(function(){setUserSetting(&quot;align&quot;,a(this).val())}).filter(function(){if(a(this).val()==c){return true}return false}).attr(&quot;checked&quot;,&quot;checked&quot;);a('tr.image-size input[type=&quot;radio&quot;]').click(function(){setUserSetting(&quot;imgsize&quot;,a(this).val())}).filter(function(){if(a(this).attr(&quot;disabled&quot;)||a(this).val()!=b){return false}return true}).attr(&quot;checked&quot;,&quot;checked&quot;);a(&quot;tr.url button&quot;).click(function(){var d=this.className||&quot;&quot;;d=d.replace(/.*?(url[^ '&quot;]+).*/,&quot;$1&quot;);if(d){setUserSetting(&quot;urlbutton&quot;,d)}a(this).siblings(&quot;.urlfield&quot;).val(a(this).attr(&quot;title&quot;))});a(&quot;tr.url .urlfield&quot;).each(function(){var d=getUserSetting(&quot;urlbutton&quot;);a(this).val(a(this).siblings(&quot;button.&quot;+d).attr(&quot;title&quot;))})}})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}function fileQueued(a){jQuery(&quot;.media-blank&quot;).remove();if(jQuery(&quot;.type-form #media-items&gt;*&quot;).length==1&amp;&amp;jQuery(&quot;#media-items .hidden&quot;).length&gt;0){jQuery(&quot;.describe-toggle-on&quot;).show();jQuery(&quot;.describe-toggle-off&quot;).hide();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+a.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; '+a.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;#media-item-&quot;+a.id+&quot; .progress&quot;).show();jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}function uploadStart(a){return true}function uploadProgress(d,b,c){var a=jQuery(&quot;#media-items&quot;).width()-2;jQuery(&quot;#media-item-&quot;+d.id+&quot; .bar&quot;).width(a*b/c);jQuery(&quot;#media-item-&quot;+d.id+&quot; .percent&quot;).html(Math.ceil(b/c*100)+&quot;%&quot;);if(b==c){jQuery(&quot;#media-item-&quot;+d.id+&quot; .bar&quot;).html('&lt;strong class=&quot;crunching&quot;&gt;'+swfuploadL10n.crunching+&quot;&lt;/strong&gt;&quot;)}}function prepareMediaItem(b,a){jQuery(&quot;#media-item-&quot;+b.id+&quot; .bar&quot;).remove();jQuery(&quot;#media-item-&quot;+b.id+&quot; .progress&quot;).hide();var c=(typeof shortform==&quot;undefined&quot;)?1:2;if(isNaN(a)||!a){jQuery(&quot;#media-item-&quot;+b.id).append(a);prepareMediaItemInit(b)}else{jQuery(&quot;#media-item-&quot;+b.id).load(&quot;async-upload.php&quot;,{attachment_id:a,fetch:c},function(){prepareMediaItemInit(b);updateMediaForm()})}}function prepareMediaItemInit(a){jQuery(&quot;#media-item-&quot;+a.id+&quot; .thumbnail&quot;).clone().attr(&quot;className&quot;,&quot;pinkynail toggle&quot;).prependTo(&quot;#media-item-&quot;+a.id);jQuery(&quot;#media-item-&quot;+a.id+&quot; .filename.original&quot;).replaceWith(jQuery(&quot;#media-item-&quot;+a.id+&quot; .filename.new&quot;));jQuery(&quot;#media-item-&quot;+a.id+&quot; a.toggle&quot;).click(function(){jQuery(this).siblings(&quot;.slidetoggle&quot;).slideToggle(150,function(){var b=jQuery(this).offset();window.scrollTo(0,b.top-36)});jQuery(this).parent().children(&quot;.toggle&quot;).toggle();jQuery(this).siblings(&quot;a.toggle&quot;).focus();return false});jQuery(&quot;#media-item-&quot;+a.id+&quot; a.delete&quot;).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,success:deleteSuccess,error:deleteError,id:a.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;trash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)}});return false});jQuery(&quot;#media-item-&quot;+a.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).slideToggle(500).parent().children(&quot;.toggle&quot;).toggle()}function itemAjaxError(c,b){var a=jQuery(&quot;#media-item-error&quot;+c);a.html('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+c+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);jQuery(&quot;#dismiss-&quot;+c).click(function(){jQuery(this).parents(&quot;.file-error&quot;).slideUp(200,function(){jQuery(this).empty()})})}function deleteSuccess(b,c){if(b==&quot;-1&quot;){return itemAjaxError(this.id,&quot;You do not have permission. Has your session expired?&quot;)}if(b==&quot;0&quot;){return itemAjaxError(this.id,&quot;Could not be deleted. Has it been deleted already?&quot;)}var a=jQuery(&quot;#media-item-&quot;+this.id);if(type=jQuery(&quot;#type-of-&quot;+this.id).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-1)}if(a.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-1)}if(jQuery(&quot;.type-form #media-items&gt;*&quot;).length==1&amp;&amp;jQuery(&quot;#media-items .hidden&quot;).length&gt;0){jQuery(&quot;.toggle&quot;).toggle();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-item-&quot;+this.id+&quot; .filename:empty&quot;).remove();jQuery(&quot;#media-item-&quot;+this.id+&quot; .filename&quot;).append(' &lt;span class=&quot;file-error&quot;&gt;'+swfuploadL10n.deleted+&quot;&lt;/span&gt;&quot;).siblings(&quot;a.toggle&quot;).remove();jQuery(&quot;#media-item-&quot;+this.id).children(&quot;.describe&quot;).css({backgroundColor:&quot;#fff&quot;}).end().animate({backgroundColor:&quot;#ffc0c0&quot;},{queue:false,duration:50}).animate({minHeight:0,height:36},400,null,function(){jQuery(this).children(&quot;.describe&quot;).remove()}).animate({backgroundColor:&quot;#fff&quot;},400).animate({height:0},800,null,function(){jQuery(this).remove();updateMediaForm()});return}function deleteError(c,b,a){}function updateMediaForm(){storeState();if(jQuery(&quot;.type-form #media-items&gt;*&quot;).length==1){jQuery(&quot;#media-items .slidetoggle&quot;).slideDown(500).parent().eq(0).children(&quot;.toggle&quot;).toggle();jQuery(&quot;.type-form .slidetoggle&quot;).siblings().addClass(&quot;hidden&quot;)}if(jQuery(&quot;#media-items&gt;*&quot;).not(&quot;.media-blank&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}if(jQuery(&quot;#media-items&gt;*&quot;).length&gt;1){jQuery(&quot;.insert-gallery&quot;).show()}else{jQuery(&quot;.insert-gallery&quot;).hide()}}function uploadSuccess(b,a){if(a.match(&quot;media-upload-error&quot;)){jQuery(&quot;#media-item-&quot;+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery(&quot;#media-item-&quot;+b.id).hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)}function wpFileError(b,a){jQuery(&quot;#media-item-&quot;+b.id+&quot; .filename&quot;).after('&lt;div class=&quot;file-error&quot;&gt;&lt;button type=&quot;button&quot; id=&quot;dismiss-'+b.id+'&quot; class=&quot;button dismiss&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/button&gt;&quot;+a+&quot;&lt;/div&gt;&quot;).siblings(&quot;.toggle&quot;).remove();jQuery(&quot;#dismiss-&quot;+b.id).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(b){try{if(b&gt;0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display=&quot;block&quot;;a.style.display=&quot;none&quot;}else{c.style.display=&quot;none&quot;;a.style.display=&quot;block&quot;}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery(&quot;#media-item-&quot;+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}var storeState;(function(a){storeState=function(){var c=getUserSetting(&quot;align&quot;)||&quot;&quot;,b=getUserSetting(&quot;imgsize&quot;)||&quot;&quot;;a('tr.align input[type=&quot;radio&quot;]').click(function(){setUserSetting(&quot;align&quot;,a(this).val())}).filter(function(){if(a(this).val()==c){return true}return false}).attr(&quot;checked&quot;,&quot;checked&quot;);a('tr.image-size input[type=&quot;radio&quot;]').click(function(){setUserSetting(&quot;imgsize&quot;,a(this).val())}).filter(function(){if(a(this).attr(&quot;disabled&quot;)||a(this).val()!=b){return false}return true}).attr(&quot;checked&quot;,&quot;checked&quot;);a(&quot;tr.url button&quot;).click(function(){var d=this.className||&quot;&quot;;d=d.replace(/.*?(url[^ '&quot;]+).*/,&quot;$1&quot;);if(d){setUserSetting(&quot;urlbutton&quot;,d)}a(this).siblings(&quot;.urlfield&quot;).val(a(this).attr(&quot;title&quot;))});a(&quot;tr.url .urlfield&quot;).each(function(){var d=getUserSetting(&quot;urlbutton&quot;);a(this).val(a(this).siblings(&quot;button.&quot;+d).attr(&quot;title&quot;))})}})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-includes/post.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -1264,7 +1264,7 @@
</span><span class="cx"> 
</span><span class="cx">         do_action('untrash_post', $postid);
</span><span class="cx"> 
</span><del>-        $post['post_status'] = 'draft';
</del><ins>+        $post['post_status'] = ($post-&gt;post_type == 'attachment') ? 'inherit' : 'draft';
</ins><span class="cx"> 
</span><span class="cx">         $trash_meta = get_option('wp_trash_meta');
</span><span class="cx">         if ( is_array($trash_meta) &amp;&amp; isset($trash_meta['posts'][$postid]) ) {
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (11840 => 11841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-08-19 02:30:42 UTC (rev 11840)
+++ trunk/wp-includes/script-loader.php        2009-08-19 08:35:24 UTC (rev 11841)
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx">                 $scripts-&gt;add( 'swfupload-all', '/wp-includes/js/swfupload/swfupload-all.js', array(), '2201');
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'swfupload-handlers', &quot;/wp-includes/js/swfupload/handlers$suffix.js&quot;, array('swfupload-all', 'jquery'), '2201-20090515');
</del><ins>+        $scripts-&gt;add( 'swfupload-handlers', &quot;/wp-includes/js/swfupload/handlers$suffix.js&quot;, array('swfupload-all', 'jquery'), '2201-20090818');
</ins><span class="cx">         // these error messages came from the sample swfupload js, they might need changing.
</span><span class="cx">         $scripts-&gt;localize( 'swfupload-handlers', 'swfuploadL10n', array(
</span><span class="cx">                         'queue_limit_exceeded' =&gt; __('You have attempted to queue too many files.'),
</span></span></pre>
</div>
</div>

</body>
</html>