X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..607b7e02d77e7326161e8ec15639052d2040f745:/wp-admin/js/media.js diff --git a/wp-admin/js/media.js b/wp-admin/js/media.js index f0c21752..e23adebb 100644 --- a/wp-admin/js/media.js +++ b/wp-admin/js/media.js @@ -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(); + } } }); });