Make WordPress Core


Ignore:
Timestamp:
11/27/2012 03:50:59 PM (14 years ago)
Author:
ryan
Message:

Add a delete link to the media modal.

Props merty, nacin, koopersmith
fixes #22524

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r22868 r22869  
    13281328                'icon'        => wp_mime_type_icon( $attachment->ID ),
    13291329                'dateFormatted' => mysql2date( get_option('date_format'), $attachment->post_date ),
     1330                'nonces'      => array(
     1331                        'update' => wp_create_nonce( 'update-post_' . $attachment->ID ),
     1332                        'delete' => wp_create_nonce( 'delete-post_' . $attachment->ID ),
     1333                ),
    13301334        );
    13311335
     
    14531457                'insertIntoPost'     => $hier ? __( 'Insert into page' ) : __( 'Insert into post' ),
    14541458                'uploadedToThisPost' => $hier ? __( 'Uploaded to this page' ) : __( 'Uploaded to this post' ),
     1459                'warnDelete' =>      __( "You are about to permanently delete this item.\n  'Cancel' to stop, 'OK' to delete." ),
    14551460
    14561461                // From URL
     
    16411646                                <# if ( 'image' === data.type && ! data.uploading ) { #>
    16421647                                        <div class="dimensions">{{ data.width }} &times; {{ data.height }}</div>
     1648                                <# } #>
     1649                                <# if ( ! data.uploading ) { #>
     1650                                        <div class="delete-attachment">
     1651                                                <a href="#"><?php _e( 'Delete Permanently' ); ?></a>
     1652                                        </div>
    16431653                                <# } #>
    16441654                        </div>
Note: See TracChangeset for help on using the changeset viewer.