Make WordPress Core

Changeset 12593


Ignore:
Timestamp:
12/31/2009 10:22:44 AM (15 years ago)
Author:
azaozz
Message:

Add AYS popup when deleting media, fixes #11673 for 2.9

Location:
branches/2.9/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9/wp-admin/edit-attachment-rows.php

    r12377 r12593  
    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>";
    99             if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH )
    100                 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
     99            if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
     100                $delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : '';
     101                $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>";
     102            }
    101103        }
    102104        if ( !$is_trash )
  • branches/2.9/wp-admin/upload.php

    r12377 r12593  
    393393            $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
    394394        if ( current_user_can('delete_post', $post->ID) )
    395             if ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
     395            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>";
    397             else
    398                 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
     397            } else {
     398                $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
     399                $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>";
     400            }
    399401        $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    400402        if ( current_user_can('edit_post', $post->ID) )
Note: See TracChangeset for help on using the changeset viewer.