diff --git a/src/wp-admin/js/post.js b/src/wp-admin/js/post.js index 46a5556798..c2a14a647d 100644 --- a/src/wp-admin/js/post.js +++ b/src/wp-admin/js/post.js @@ -266,9 +266,13 @@ jQuery(document).ready( function($) { wp.autosave.server.suspend(); } - // Close the comment edit/reply form if open to stop the form - // action from interfering with the post's form action. - commentReply.close(); + if ( typeof commentReply !== 'undefined' ) { + /* + * Close the comment edit/reply form if open to stop the form + * action from interfering with the post's form action. + */ + commentReply.close(); + } releaseLock = false; $(window).off( 'beforeunload.edit-post' );