Ticket #22524: 22524.2.patch

File 22524.2.patch, 1.1 KB (added by merty, 6 months ago)
  • wp-includes/media.php

     
    12651265                'subtype'     => $subtype, 
    12661266                'icon'        => wp_mime_type_icon( $attachment->ID ), 
    12671267                'dateFormatted' => mysql2date( get_option('date_format'), $attachment->post_date ), 
     1268                'deleteLink'    => wp_nonce_url( "post.php?action=delete&post=$attachment->ID", 'delete-post_' . $attachment->ID ), 
     1269                'editLink'      => get_edit_post_link( $attachment->ID, true ), 
    12681270        ); 
    12691271 
    12701272        if ( $meta && 'image' === $type ) { 
     
    15011503                                <# if ( 'image' === data.type && ! data.uploading ) { #> 
    15021504                                        <div class="dimensions">{{ data.width }} &times; {{ data.height }}</div> 
    15031505                                <# } #> 
     1506                                <div class="edit-link"> 
     1507                                        <a href="{{ data.editLink }}" target="_blank"><?php _e( 'Edit' ) ?></a> 
     1508                                </div> 
     1509                                <div class="delete-link"> 
     1510                                        <a href="{{ data.deleteLink }}" onclick="return showNotice.warn();"><?php _e( 'Delete Permanently' ) ?></a> 
     1511                                </div> 
    15041512                        </div> 
    15051513                        <div class="compat-meta"> 
    15061514                                <# if ( data.compat && data.compat.meta ) { #>