Anyone know of a nice way to disable that pop-up dialogue when exiting the post-editor? It says "This page is asking you to confirm that you want to leave - data you have entered may not be saved."
Nice feature, but annoying in certain blogs where I have to edit a ton of posts
Anyone know of a nice way to disable that pop-up dialogue when exiting the post-editor? It says "This page is asking you to confirm that you want to leave - data you have entered may not be saved."
Nice feature, but annoying in certain blogs where I have to edit a ton of posts
Share Improve this question asked Dec 8, 2011 at 17:55 endle.wintersendle.winters 3392 silver badges6 bronze badges3 Answers
Reset to default 1You can use the method described here. Add the following to your functions.php
<?php
function wpse35898_admin_head() {
?>
<script type="text/javascript">
window.onbeforeunload = function() {};
</script>
<?php
}
add_action( 'admin_head' , 'wpse35898_admin_head' );
?>
tinyMCE.init({
.................................
.................................
autosave_ask_before_unload:false
})
as this page
you must to add "autosave_ask_before_unload: false" in init of tinymce(as bottom code):
tinymce.init({
mode: 'textareas',
menubar: false,
statusbar: false,
language: 'sv_SE',
autosave_ask_before_unload: false,
...
and you must be add bottom code in your page:
<script>
window.onbeforeunload = function() {};
</script>