Make WordPress Core

Changeset 29491


Ignore:
Timestamp:
08/14/2014 06:50:04 PM (10 years ago)
Author:
wonderboymusic
Message:

Media Grid, support MEDIA_TRASH:

  • Only use the special trashAttachment logic when in edit-metadata mode.
  • Don't support the trash filter in the Add Media modal for now.
  • Properly toggle trash/untrash logic in the Attachment Details sidebar

See #29145.

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

Legend:

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

    r29490 r29491  
    57195719            };
    57205720
    5721             if ( media.view.settings.mediaTrash ) {
     5721            if ( media.view.settings.mediaTrash
     5722                && this.controller.activeModes.where( { id: 'grid' } ).length ) {
    57225723                filters.trash = {
    57235724                    text:  l10n.trash,
     
    65006501            event.preventDefault();
    65016502
    6502             if ( media.view.settings.mediaTrash ) {
     6503            if ( media.view.settings.mediaTrash
     6504                && 'edit-metadata' === this.controller.content.mode() ) {
    65036505                this.model.set( 'status', 'trash' );
    65046506                this.model.save().done( function() {
  • trunk/src/wp-includes/media-template.php

    r29490 r29491  
    509509                <# if ( ! data.uploading && data.can.remove ) { #>
    510510                    <?php if ( MEDIA_TRASH ): ?>
     511                    <# if ( 'trash' === data.status ) { #>
     512                        <a class="untrash-attachment" href="#"><?php _e( 'Untrash' ); ?></a>
     513                    <# } else { #>
    511514                        <a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>
     515                    <# } #>
    512516                    <?php else: ?>
    513517                        <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
Note: See TracChangeset for help on using the changeset viewer.