I am writing a plugin that adds a custom metabox to the post page. I would like to trigger an event when the user navigates away from the edit post page or when a user stops editing a specific post. Is there a way to listen to events on the post page?
Leave a Reply
You must be logged in to post a comment.
This is more of a JavaScript the A WordPress Question but anyway, You can use the JavaScript
onbeforeunload
event something like: