Make WordPress Core


Ignore:
Timestamp:
11/10/2009 10:38:19 AM (17 years ago)
Author:
azaozz
Message:

Remove all instances of "Trash" from the UI when Trash is disabled, replace trash actions with "Delete permanently", props caesarsgrunt, see #4529

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upload.php

    r12121 r12162  
    239239}
    240240$type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . __('Unattached') . '</a>';
    241 $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>';
     241if ( EMPTY_TRASH_DAYS )
     242        $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>';
    242243
    243244echo implode( " |</li>\n", $type_links) . '</li>';
     
    283284<?php if ( $is_trash ) { ?>
    284285<option value="untrash"><?php _e('Restore'); ?></option>
     286<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
    285287<option value="delete"><?php _e('Delete Permanently'); ?></option>
    286288<?php } else { ?>
     
    386388                        $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
    387389                if ( current_user_can('delete_post', $post->ID) )
    388                         $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
     390                        if ( EMPTY_TRASH_DAYS )
     391                                $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
     392                        else
     393                                $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
    389394                $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    390395                if ( current_user_can('edit_post', $post->ID) )
     
    445450<?php if ($is_trash) { ?>
    446451<option value="untrash"><?php _e('Restore'); ?></option>
     452<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
    447453<option value="delete"><?php _e('Delete Permanently'); ?></option>
    448454<?php } else { ?>
Note: See TracChangeset for help on using the changeset viewer.