Closed boonebgorges closed 9 years ago
By default, in the admin area, a WP post is an auto-draft. Later, WP uses autosave via JS to switch it to a draft.
I deliberately removed this autosave functionality for now because we do not have a frontend UI to manage drafts at the moment. Sorry for making you jump through hoops!
Ha, no problem at all - your approach is elegant, it's just that when combined with the way that EO handles creating/editing items, it ended up being kinda odd. Anyway, it's working now :)
This is now working, but it's pretty precarious. Because we're using an abstracted version of wp-admin on the front end, which uses an auto-draft post, it's very difficult to detect the creation of a new post through normal hooks like 'save_post' - they always come through as edits. My clunky solution is to use 'transition_post_status' to catch the publishing of new posts - 'bpeo_create_event' - and then rely on 'edit_post' to catch edit events. Let's see how it holds up :-D