Media Grid, support `MEDIA_TRASH`: add AYS to bulk actions.

See #29145.


git-svn-id: https://develop.svn.wordpress.org/trunk@29492 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-14 19:07:06 +00:00
parent 7308949ea3
commit d0441a6b42
2 changed files with 15 additions and 0 deletions

View File

@ -5874,6 +5874,20 @@
selection = this.controller.state().get( 'selection' ),
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 ) {
model = selection.at( 0 );
if ( media.view.settings.mediaTrash && 'trash' === model.get( 'status' ) ) {

View File

@ -2936,6 +2936,7 @@ function wp_enqueue_media( $args = array() ) {
'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." ),
'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' ),
'cancelSelection' => __( 'Cancel Selection' ),
'trashSelected' => __( 'Trash Selected' ),