mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 20:15:08 +00:00
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. Built from https://develop.svn.wordpress.org/trunk@29491 git-svn-id: http://core.svn.wordpress.org/trunk@29269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
571111022e
commit
df4cc86671
@ -5718,7 +5718,8 @@
|
|||||||
priority: 50
|
priority: 50
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( media.view.settings.mediaTrash ) {
|
if ( media.view.settings.mediaTrash
|
||||||
|
&& this.controller.activeModes.where( { id: 'grid' } ).length ) {
|
||||||
filters.trash = {
|
filters.trash = {
|
||||||
text: l10n.trash,
|
text: l10n.trash,
|
||||||
props: {
|
props: {
|
||||||
@ -6499,7 +6500,8 @@
|
|||||||
var library = this.controller.library;
|
var library = this.controller.library;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if ( media.view.settings.mediaTrash ) {
|
if ( media.view.settings.mediaTrash
|
||||||
|
&& 'edit-metadata' === this.controller.content.mode() ) {
|
||||||
this.model.set( 'status', 'trash' );
|
this.model.set( 'status', 'trash' );
|
||||||
this.model.save().done( function() {
|
this.model.save().done( function() {
|
||||||
library._requery( true );
|
library._requery( true );
|
||||||
|
2
wp-includes/js/media-views.min.js
vendored
2
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
@ -508,7 +508,11 @@ function wp_print_media_templates() {
|
|||||||
|
|
||||||
<# if ( ! data.uploading && data.can.remove ) { #>
|
<# if ( ! data.uploading && data.can.remove ) { #>
|
||||||
<?php if ( MEDIA_TRASH ): ?>
|
<?php if ( MEDIA_TRASH ): ?>
|
||||||
|
<# if ( 'trash' === data.status ) { #>
|
||||||
|
<a class="untrash-attachment" href="#"><?php _e( 'Untrash' ); ?></a>
|
||||||
|
<# } else { #>
|
||||||
<a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>
|
<a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>
|
||||||
|
<# } #>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
|
<a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user