]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/post.js
Wordpress 4.6-scripts
[autoinstalls/wordpress.git] / wp-admin / js / post.js
index a4011b449d1066e6e58f097a0a561b4126a82cea..1ead4bed1cc0e4c3bb06ee513f91a6930f637f84 100644 (file)
@@ -271,6 +271,14 @@ jQuery(document).ready( function($) {
                        }
 
                        if ( typeof commentReply !== 'undefined' ) {
+                               /*
+                                * Warn the user they have an unsaved comment before submitting
+                                * the post data for update.
+                                */
+                               if ( ! commentReply.discardCommentChanges() ) {
+                                       return false;
+                               }
+
                                /*
                                 * Close the comment edit/reply form if open to stop the form
                                 * action from interfering with the post's form action.