Media: Prompt when deleting multiple items from the Media Library
We prompt when deleting a single item from the Media Library, but not when deleting multiple items. This inconsistency is now rectified. Props southp. Fixes #28235. git-svn-id: https://develop.svn.wordpress.org/trunk@37859 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
044064dcce
commit
d4c360d186
@ -1,4 +1,4 @@
|
||||
/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings */
|
||||
/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice */
|
||||
|
||||
var findPosts;
|
||||
( function( $ ){
|
||||
@ -99,9 +99,15 @@ var findPosts;
|
||||
$( '#find-posts-close' ).click( findPosts.close );
|
||||
$( '#doaction, #doaction2' ).click( function( event ) {
|
||||
$( 'select[name^="action"]' ).each( function() {
|
||||
if ( $(this).val() === 'attach' ) {
|
||||
var optionValue = $( this ).val();
|
||||
|
||||
if ( 'attach' === optionValue ) {
|
||||
event.preventDefault();
|
||||
findPosts.open();
|
||||
} else if ( 'delete' === optionValue ) {
|
||||
if ( ! showNotice.warn() ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user