[wp-hackers] WP Auto-Save drafts causing slight havoc with my plugin

Robert Deaton false.hopes at gmail.com
Tue Oct 17 18:15:40 GMT 2006


On 10/17/06, Alex King <lists at alexking.org> wrote:
> I think this new behavior is going to cause some chaos with various
> plugins, and it's worth talking about. A new plugin I'm working on
> will be affected here, and I've been trying to figure out th best way
> to handle it without adding a large load to each save/update.
>
> Should there be an "auto-save" state that doesn't fire any of the
> standard "post creation" hooks? If not, then I think we have to
> expect plugins that need to do something "on post save" will likely
> cause the auto-save function to become heavier as they each have to
> check their existing data, the add/update their meta as needed.
>
> I'm not saying that the WP behavior should change, I'm saying that
> plugin devs have likely relied on existing behavior that is now
> slightly different because it no longer requires user interaction.
> Perhaps a "best practice" doc in codex from someone who is intimate
> with all of the "post saving" hooks is a good solution.

I'm not opposed to making autosave perform like a normal post draft
save. The requests to the server will become larger, and its a little
bit more difficult to maintain. We could also somehow add some hooks
in the javascript that add whatever a plugin wants to the autosave
request. I'd rather not extend the WP API to have a special state on
the backend for autosave in wp_insert_post or wp_update_post, etc.

-- 
--Robert Deaton


More information about the wp-hackers mailing list