Custom Fields – Lost by Autosave??
-
I’m writing a custom events plugin that integrates to the WordPress edit post/page admin screen, and it works like a charm…
that is, until you leave the post open in the editor for “too long” (i’m guessing over 2 minutes, though I haven’t verified this yet…that’s the length of my autosave interval). Here’s the gist:My plugin adds an event box to the sidebar of the edit post/page screen using the following hooks/filters:
edit_post, publish_post, save_post, delete_post, admin_menu, manage_posts_columns, manage_pages_columnsWhen a post/page is published, if this event box is checked, then I write some stuff to the database and add 2 custom fields to the post/page: _bec_expiration (the expiration date of the event) and _bec_id (the db id of the event). (The underscores are so WordPress doesn’t display in the standard custom field section).
However, if I then leave the post up in the editor for a few minutes (?2 or longer?), then return and leave the page (without changing and/or updating my post), my custom fields, and hence my event information, is gone! -poof!-
I’m unable to find a hook into the autosave feature of WordPress, and I’m unable to disable this functionality. (I already had to disable revisioning which interfered with my plugin also by pulling the post revision id instead of the post id).
Any ideas?
- The topic ‘Custom Fields – Lost by Autosave??’ is closed to new replies.