Index: wp-admin/edit-comments.php
===================================================================
--- wp-admin/edit-comments.php	(revision 12161)
+++ wp-admin/edit-comments.php	(working copy)
@@ -163,6 +163,7 @@
 		'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
 		'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
 	);
+if (EMPTY_TRASH_DAYS == 0) unset($stati['trash']);
 $link = 'edit-comments.php';
 if ( !empty($comment_type) && 'all' != $comment_type )
 	$link = add_query_arg( 'comment_type', $comment_type, $link );
@@ -275,7 +276,7 @@
 <?php if ( 'trash' == $comment_status ): ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
 <?php endif; ?>
-<?php if ( 'trash' == $comment_status || 'spam' == $comment_status ): ?>
+<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || EMPTY_TRASH_DAYS == 0 ): ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php else: ?>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
@@ -371,7 +372,7 @@
 <?php if ( 'trash' == $comment_status ): ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
 <?php endif; ?>
-<?php if ( 'trash' == $comment_status || 'spam' == $comment_status ): ?>
+<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || EMPTY_TRASH_DAYS == 0 ): ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php else: ?>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
Index: wp-admin/includes/dashboard.php
===================================================================
--- wp-admin/includes/dashboard.php	(revision 12161)
+++ wp-admin/includes/dashboard.php	(working copy)
@@ -540,13 +540,17 @@
 		$unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
 		$spam_url = esc_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
 		$trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
+		$delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
 
 		$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
 		$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
 		$actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
 		$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
 		$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */  _x( 'Spam', 'verb' ) . '</a>';
-		$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-t vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
+		if (EMPTY_TRASH_DAYS == 0)
+			$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
+		else
+			$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
 
 		$actions = apply_filters( 'comment_row_actions', $actions, $comment );
 
Index: wp-admin/includes/meta-boxes.php
===================================================================
--- wp-admin/includes/meta-boxes.php	(revision 12161)
+++ wp-admin/includes/meta-boxes.php	(working copy)
@@ -185,8 +185,8 @@
 <div id="delete-action">
 <?php
 if ( current_user_can("delete_${post_type}", $post->ID) ) { ?>
-<?php $delete_url = add_query_arg( array('action'=>'trash', 'post'=>$post->ID) ); ?>
-<a class="submitdelete deletion<?php if ( 'edit' != $action ) { echo " hidden"; } ?>" href="<?php echo wp_nonce_url($delete_url, "trash-${post_type}_" . $post->ID); ?>"><?php _e('Move to Trash'); ?></a>
+<?php $delete_url = add_query_arg( array('action'=>( EMPTY_TRASH_DAYS == 0 ? 'delete' : 'trash' ), 'post'=>$post->ID) ); ?>
+<a class="submitdelete deletion<?php if ( 'edit' != $action ) { echo " hidden"; } ?>" href="<?php echo wp_nonce_url($delete_url, ( EMPTY_TRASH_DAYS == 0 ? "delete-${post_type}_" : "trash-${post_type}_" ) . $post->ID); ?>"><?php _e( EMPTY_TRASH_DAYS == 0 ? 'Delete Permanently' : 'Move to Trash' ); ?></a>
 <?php } ?>
 </div>
 
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 12161)
+++ wp-admin/includes/template.php	(working copy)
@@ -1444,26 +1444,24 @@
 				the_excerpt();
 
 			$actions = array();
-			if ('trash' == $post->post_status) {
-				if ( current_user_can('delete_post', $post->ID) ) {
+			if ( current_user_can('edit_post', $post->ID) && 'trash' != $post->post_status ) {
+				$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
+				$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick&nbsp;Edit') . '</a>';
+			}
+			if ( current_user_can('delete_post', $post->ID) ) {
+				if ('trash' == $post->post_status)
 					$actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
+				elseif (EMPTY_TRASH_DAYS > 0)
+					$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
+				if ('trash' == $post->post_status || EMPTY_TRASH_DAYS == 0)
 					$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
-				}
-			} else {
-				if ( current_user_can('edit_post', $post->ID) ) {
-					$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
-					$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick&nbsp;Edit') . '</a>';
-				}
-				if ( current_user_can('delete_post', $post->ID) ) {
-					$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
-				}
-				if ( in_array($post->post_status, array('pending', 'draft')) ) {
-					if ( current_user_can('edit_post', $post->ID) )
-						$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
-				} else {
-					$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
-				}
 			}
+			if ( in_array($post->post_status, array('pending', 'draft')) ) {
+				if ( current_user_can('edit_post', $post->ID) )
+					$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
+			} elseif ('trash' != $post->post_status) {
+				$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
+			}
 			$actions = apply_filters('post_row_actions', $actions, $post);
 			$action_count = count($actions);
 			$i = 0;
@@ -1666,24 +1664,24 @@
 		<td <?php echo $attributes ?>><strong><?php if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?></strong>
 		<?php
 		$actions = array();
-		if ($post->post_status == 'trash' && current_user_can('delete_page', $page->ID)) {
-			$actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&amp;post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
-			$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
-		} else {
-			if ( current_user_can('edit_page', $page->ID) ) {
-				$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
-				$actions['inline'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
-			}
-			if ( current_user_can('delete_page', $page->ID) ) {
+		if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) {
+			$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
+			$actions['inline'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
+		}
+		if ( current_user_can('delete_page', $page->ID) ) {
+			if ($post->post_status == 'trash')
+				$actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&amp;post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
+			elseif (EMPTY_TRASH_DAYS > 0)
 				$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
-			}
-			if ( in_array($post->post_status, array('pending', 'draft')) ) {
-				if ( current_user_can('edit_page', $page->ID) )
-					$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
-			} else {
-				$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
-			}
+			if ($post->post_status == 'trash' || EMPTY_TRASH_DAYS == 0)
+				$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
 		}
+		if ( in_array($post->post_status, array('pending', 'draft')) ) {
+			if ( current_user_can('edit_page', $page->ID) )
+				$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
+		} elseif ($post->post_status != 'trash') {
+			$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
+		}
 		$actions = apply_filters('page_row_actions', $actions, $page);
 		$action_count = count($actions);
 
@@ -2180,9 +2178,11 @@
 						}
 
 						if ( 'spam' == $the_comment_status ) {
+							$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
+						}
+						if ( 'spam' == $the_comment_status || EMPTY_TRASH_DAYS == 0 ) {
 							$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
 						} else {
-							$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
 							$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
 						}
 
Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php	(revision 12161)
+++ wp-admin/includes/media.php	(working copy)
@@ -1201,12 +1201,13 @@
 		'extra_rows' => array(),
 	);
 
+	$delete_href = wp_nonce_url("post.php?action=delete&amp;post=$attachment_id", 'delete-post_' . $attachment_id);
 	$trash_href = wp_nonce_url("post.php?action=trash&amp;post=$attachment_id", 'trash-post_' . $attachment_id);
 	$untrash_href = wp_nonce_url("post.php?action=untrash&amp;post=$attachment_id", 'untrash-post_' . $attachment_id);
 	if ( $send )
 		$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
 	if ( $delete )
-		$delete = current_user_can('delete_post', $attachment_id) ? "<a href=\"$trash_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Move to Trash') . "</a> <a href=\"$untrash_href\" id=\"undo[$attachment_id]\" class=\"undo hidden\">" . __('Undo?') . "</a>" : "";
+		$delete = current_user_can('delete_post', $attachment_id) ? "<a href=\"" . ( EMPTY_TRASH_DAYS == 0 ? $delete_href : $trash_href ) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __( EMPTY_TRASH_DAYS == 0 ? 'Delete Permanently' : 'Move to Trash' ) . "</a> <a href=\"$untrash_href\" id=\"undo[$attachment_id]\" class=\"undo hidden\">" . __('Undo?') . "</a>" : "";
 	if ( 'image' == $type && current_theme_supports( 'post-thumbnails' ) && get_post_image_id($_GET['post_id']) != $attachment_id )
 		$thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>";
 
Index: wp-admin/edit-attachment-rows.php
===================================================================
--- wp-admin/edit-attachment-rows.php	(revision 12161)
+++ wp-admin/edit-attachment-rows.php	(working copy)
@@ -89,18 +89,17 @@
 		<p>
 		<?php
 		$actions = array();
-		if ( $is_trash ) {
-			if ( current_user_can('delete_post', $post->ID) ) {
+		if ( current_user_can('edit_post', $post->ID) && !$is_trash )
+			$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
+		if ( current_user_can('delete_post', $post->ID) ) {
+			if ($is_trash)
 				$actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
-				$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
-			}
-		} else {
-			if ( current_user_can('edit_post', $post->ID) )
-				$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
-			if ( current_user_can('delete_post', $post->ID) )
+			elseif (EMPTY_TRASH_DAYS > 0)
 				$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
-			$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
+			else
+				$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
 		}
+		$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
 		$action_count = count($actions);
 		$i = 0;
 		echo '<div class="row-actions">';
Index: wp-admin/upload.php
===================================================================
--- wp-admin/upload.php	(revision 12161)
+++ wp-admin/upload.php	(working copy)
@@ -238,7 +238,7 @@
 	$type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
 }
 $type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . __('Unattached') . '</a>';
-$type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
+if (EMPTY_TRASH_DAYS > 0) $type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
 
 echo implode( " |</li>\n", $type_links) . '</li>';
 unset($type_links);
@@ -282,6 +282,7 @@
 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
 <?php if ( $is_trash ) { ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
+<?php } if ( $is_trash || EMPTY_TRASH_DAYS == 0 ) { ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php } else { ?>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
@@ -385,7 +386,10 @@
 		if ( current_user_can('edit_post', $post->ID) )
 			$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
 		if ( current_user_can('delete_post', $post->ID) )
-			$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
+			if ( EMPTY_TRASH_DAYS > 0 )
+				$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
+			else
+				$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
 		$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
 		if ( current_user_can('edit_post', $post->ID) )
 			$actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;" class="hide-if-no-js">'.__('Attach').'</a>';
@@ -444,6 +448,7 @@
 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
 <?php if ($is_trash) { ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
+<?php } if ( $is_trash || EMPTY_TRASH_DAYS == 0 ) { ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php } else { ?>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
Index: wp-admin/edit-form-comment.php
===================================================================
--- wp-admin/edit-form-comment.php	(revision 12161)
+++ wp-admin/edit-form-comment.php	(working copy)
@@ -68,7 +68,7 @@
 
 <div id="major-publishing-actions">
 <div id="delete-action">
-<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=trashcomment&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . __('Move to Trash') . "</a>\n"; ?>
+<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( EMPTY_TRASH_DAYS == 0 ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( EMPTY_TRASH_DAYS == 0 ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
 </div>
 <div id="publishing-action">
 <input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" />
Index: wp-admin/edit.php
===================================================================
--- wp-admin/edit.php	(revision 12161)
+++ wp-admin/edit.php	(working copy)
@@ -254,9 +254,11 @@
 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
 <?php if ( $is_trash ) { ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
+<option value="edit"><?php _e('Edit'); ?></option>
+<?php } if ( $is_trash || EMPTY_TRASH_DAYS == 0 ) { ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
 <?php } ?>
 </select>
@@ -342,9 +344,11 @@
 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
 <?php if ( $is_trash ) { ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
+<option value="edit"><?php _e('Edit'); ?></option>
+<?php } if ( $is_trash || EMPTY_TRASH_DAYS == 0 ) { ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
 <?php } ?>
 </select>
Index: wp-admin/edit-pages.php
===================================================================
--- wp-admin/edit-pages.php	(revision 12161)
+++ wp-admin/edit-pages.php	(working copy)
@@ -113,6 +113,7 @@
 		'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page')),
 		'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', 'page'))
 	);
+if (EMPTY_TRASH_DAYS == 0) unset($post_stati['trash']);
 
 $post_stati = apply_filters('page_stati', $post_stati);
 
@@ -255,9 +256,11 @@
 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
 <?php if ( $is_trash ) { ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
+<option value="edit"><?php _e('Edit'); ?></option>
+<?php } if ( $is_trash || EMPTY_TRASH_DAYS == 0 ) { ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
 <?php } ?>
 </select>
@@ -302,9 +305,11 @@
 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
 <?php if ( $is_trash ) { ?>
 <option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
+<option value="edit"><?php _e('Edit'); ?></option>
+<?php } if ( $is_trash || EMPTY_TRASH_DAYS == 0 ) { ?>
 <option value="delete"><?php _e('Delete Permanently'); ?></option>
 <?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
 <option value="trash"><?php _e('Move to Trash'); ?></option>
 <?php } ?>
 </select>

