Make WordPress Core


Ignore:
Timestamp:
11/10/2009 10:38:19 AM (16 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/edit-attachment-rows.php

    r11841 r12162  
    9090        <?php
    9191        $actions = array();
    92         if ( $is_trash ) {
    93             if ( current_user_can('delete_post', $post->ID) ) {
     92        if ( current_user_can('edit_post', $post->ID) && !$is_trash )
     93            $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
     94        if ( current_user_can('delete_post', $post->ID) ) {
     95            if ( $is_trash )
    9496                $actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
     97            elseif ( EMPTY_TRASH_DAYS )
     98                $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
     99            if ( $is_trash || !EMPTY_TRASH_DAYS )
    95100                $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
    96             }
    97         } else {
    98             if ( current_user_can('edit_post', $post->ID) )
    99                 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
    100             if ( current_user_can('delete_post', $post->ID) )
    101                 $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
     101        }
     102        if ( !$is_trash )
    102103            $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    103         }
    104104        $action_count = count($actions);
    105105        $i = 0;
Note: See TracChangeset for help on using the changeset viewer.