WordPress.org

Make WordPress Core

Ticket #11673: 11673.2.against-trunk.diff

File 11673.2.against-trunk.diff, 1.9 KB (added by nacin, 4 years ago)

Patch against trunk to add EMPTY_TRASH_DAYS check.

  • wp-admin/edit-attachment-rows.php

     
    9797                        elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) 
    9898                                $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>"; 
    9999                        if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { 
    100                                 $delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : ''; 
     100                                $delete_ays = ( !$is_trash && ( !MEDIA_TRASH || !EMPTY_TRASH_DAYS ) ) ? " onclick='return showNotice.warn();'" : ''; 
    101101                                $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; 
    102102                        } 
    103103                } 
  • wp-admin/upload.php

     
    395395                        if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { 
    396396                                $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>"; 
    397397                        } else { 
    398                                 $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; 
     398                                $delete_ays = ( !MEDIA_TRASH || !EMPTY_TRASH_DAYS ) ? " onclick='return showNotice.warn();'" : ''; 
    399399                                $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; 
    400400                        } 
    401401                $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';