Make WordPress Core

Ticket #22524: 22524.diff

File 22524.diff, 1.9 KB (added by nacin, 12 years ago)
  • wp-includes/js/media-views.js

     
    34033403                        'change [data-setting]':          'updateSetting',
    34043404                        'change [data-setting] input':    'updateSetting',
    34053405                        'change [data-setting] select':   'updateSetting',
    3406                         'change [data-setting] textarea': 'updateSetting'
     3406                        'change [data-setting] textarea': 'updateSetting',
     3407                        'click .delete-attachment':       'remove'
     3408                },
     3409
     3410                remove: function(event) {
     3411                        event.preventDefault();
     3412
     3413                        if ( showNotice.warn() ) {
     3414                                $.get(deleteLink);
     3415                                // And then remove the model and clear the query cache...
     3416                        }
    34073417                }
    34083418        });
    34093419
  • wp-includes/media.php

     
    13271327                'subtype'     => $subtype,
    13281328                'icon'        => wp_mime_type_icon( $attachment->ID ),
    13291329                'dateFormatted' => mysql2date( get_option('date_format'), $attachment->post_date ),
     1330                'deleteLink'    => str_replace( '&', '&', wp_nonce_url( "post.php?action=delete&post=$attachment->ID", 'delete-post_' . $attachment->ID ) ),
     1331                'editLink'              => get_edit_post_link( $attachment->ID, 'display' ),
    13301332        );
    13311333
    13321334        if ( $meta && 'image' === $type ) {
     
    16421644                                <# if ( 'image' === data.type && ! data.uploading ) { #>
    16431645                                        <div class="dimensions">{{ data.width }} &times; {{ data.height }}</div>
    16441646                                <# } #>
     1647                                <div class="edit-link">
     1648                                        <a class="edit-attachment" href="{{ data.editLink }}" target="_blank"><?php _x( 'Edit', 'media item' ); ?></a>
     1649                                </div>
     1650                                <div class="delete-link">
     1651                                        <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ) ?></a>
     1652                                </div>
    16451653                        </div>
    16461654                        <div class="compat-meta">
    16471655                                <# if ( data.compat && data.compat.meta ) { #>