Media Grid, support `MEDIA_TRASH`: add AYS to bulk actions.
See #29145. Built from https://develop.svn.wordpress.org/trunk@29492 git-svn-id: http://core.svn.wordpress.org/trunk@29270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
df4cc86671
commit
b0c782bf08
|
@ -5874,6 +5874,20 @@
|
||||||
selection = this.controller.state().get( 'selection' ),
|
selection = this.controller.state().get( 'selection' ),
|
||||||
library = this.controller.state().get( 'library' );
|
library = this.controller.state().get( 'library' );
|
||||||
|
|
||||||
|
if ( ! selection.length ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! media.view.settings.mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( media.view.settings.mediaTrash
|
||||||
|
&& 'trash' !== selection.at( 0 ).get( 'status' )
|
||||||
|
&& ! confirm( l10n.warnBulkTrash ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while ( selection.length > 0 ) {
|
while ( selection.length > 0 ) {
|
||||||
model = selection.at( 0 );
|
model = selection.at( 0 );
|
||||||
if ( media.view.settings.mediaTrash && 'trash' === model.get( 'status' ) ) {
|
if ( media.view.settings.mediaTrash && 'trash' === model.get( 'status' ) ) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2936,6 +2936,7 @@ function wp_enqueue_media( $args = array() ) {
|
||||||
'uploadedToThisPost' => $hier ? __( 'Uploaded to this page' ) : __( 'Uploaded to this post' ),
|
'uploadedToThisPost' => $hier ? __( 'Uploaded to this page' ) : __( 'Uploaded to this post' ),
|
||||||
'warnDelete' => __( "You are about to permanently delete this item.\n 'Cancel' to stop, 'OK' to delete." ),
|
'warnDelete' => __( "You are about to permanently delete this item.\n 'Cancel' to stop, 'OK' to delete." ),
|
||||||
'warnBulkDelete' => __( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ),
|
'warnBulkDelete' => __( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ),
|
||||||
|
'warnBulkTrash' => __( "You are about to trash these items.\n 'Cancel' to stop, 'OK' to delete." ),
|
||||||
'bulkSelect' => __( 'Bulk Select' ),
|
'bulkSelect' => __( 'Bulk Select' ),
|
||||||
'cancelSelection' => __( 'Cancel Selection' ),
|
'cancelSelection' => __( 'Cancel Selection' ),
|
||||||
'trashSelected' => __( 'Trash Selected' ),
|
'trashSelected' => __( 'Trash Selected' ),
|
||||||
|
|
Loading…
Reference in New Issue