WordPress.org

Make WordPress Core

Changeset 27454


Ignore:
Timestamp:
03/07/2014 04:41:49 PM (7 years ago)
Author:
wonderboymusic
Message:

When MEDIA_TRASH is true, show the proper context in the attachment-details sidebar. Without this fix, it always showed "Delete Permanently."

Props toszcze.
Fixes #26783.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/css/media-views.css

    r27448 r27454  
    13891389.attachment-info .edit-attachment,
    13901390.attachment-info .refresh-attachment,
    1391 .attachment-info .delete-attachment {
     1391.attachment-info .delete-attachment,
     1392.attachment-info .trash-attachment {
    13921393    display: block;
    13931394    text-decoration: none;
     
    14051406}
    14061407
    1407 .attachment-info .delete-attachment {
     1408.attachment-info .delete-attachment,
     1409.attachment-info .trash-attachment {
    14081410    color: #bc0b0b;
    14091411}
    14101412
    1411 .attachment-info .delete-attachment:hover {
     1413.attachment-info .delete-attachment:hover,
     1414.attachment-info .trash-attachment:hover {
    14121415    color: red;
    14131416}
  • trunk/src/wp-includes/js/media-views.js

    r27453 r27454  
    59345934            'change [data-setting] textarea': 'updateSetting',
    59355935            'click .delete-attachment':       'deleteAttachment',
     5936            'click .trash-attachment':        'trashAttachment',
    59365937            'click .edit-attachment':         'editAttachment',
    59375938            'click .refresh-attachment':      'refreshAttachment'
     
    59715972            }
    59725973        },
    5973 
     5974        /**
     5975         * @param {Object} event
     5976         */
     5977        trashAttachment: function( event ) {
     5978            event.preventDefault();
     5979
     5980            this.model.destroy();
     5981        },
     5982        /**
     5983         * @param {Object} event
     5984         */
    59745985        editAttachment: function( event ) {
    59755986            event.preventDefault();
  • trunk/src/wp-includes/media-template.php

    r27452 r27454  
    218218
    219219                <# if ( ! data.uploading && data.can.remove ) { #>
    220                     <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
     220                    <?php if ( MEDIA_TRASH ): ?>
     221                        <a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>
     222                    <?php else: ?>
     223                        <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
     224                    <?php endif; ?>
    221225                <# } #>
    222226
Note: See TracChangeset for help on using the changeset viewer.