]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/media.js
Wordpress 4.6
[autoinstalls/wordpress.git] / wp-admin / js / media.js
index f0c21752c652a3b122e81b7cc90ec92f68db13c6..e23adebb17d8a8f3c2b85e31f06b241697ff5670 100644 (file)
@@ -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();
+                                       }
                                }
                        });
                });