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/includes/meta-boxes.php

    r12114 r12162  
    185185<div id="delete-action">
    186186<?php
    187 if ( current_user_can("delete_${post_type}", $post->ID) ) { ?>
    188 <?php $delete_url = add_query_arg( array('action'=>'trash', 'post'=>$post->ID) ); ?>
    189 <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>
    190 <?php } ?>
     187if ( current_user_can("delete_${post_type}", $post->ID) ) {
     188    if ( !EMPTY_TRASH_DAYS ) {
     189        $delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" );
     190        $delete_text = __('Delete Permanently');
     191    } else {
     192        $delete_url = wp_nonce_url( add_query_arg( array('action' => 'trash', 'post' => $post->ID) ), "trash-${post_type}_{$post->ID}" );
     193        $delete_text = __('Move to Trash');
     194    } ?>
     195<a class="submitdelete deletion<?php if ( 'edit' != $action ) { echo " hidden"; } ?>" href="<?php echo $delete_url; ?>"><?php echo $delete_text; ?></a><?php
     196} ?>
    191197</div>
    192198
Note: See TracChangeset for help on using the changeset viewer.