X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/wordpress.git/blobdiff_plain/784f914b1e4b1c62d6657e86397c2e83bcee4295..607b7e02d77e7326161e8ec15639052d2040f745:/wp-admin/js/post.js diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index a4011b44..1ead4bed 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -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.