tomjn / Frontenberg

A WP theme providing a read only demo of the post block editor on the frontend, provided as is, no support.
https://frontenberg.tomjn.com/
135 stars 30 forks source link

Enhancement: Prevent "Changes you made may not be saved." prompts #11

Closed bfintal closed 4 years ago

bfintal commented 5 years ago

Since saving is disabled anyway, it might be a good idea to force-remove the changes-not-saved prompt.

Was able to achieve this with:

window.wp.data.select( 'core/editor' ).isEditedPostDirty = function() { 
    return false;
}
tomjn commented 5 years ago

ooo that looks handy :D