[wp-hackers] Inconsistant actions, duplicated code, complicated plugins

Owen Winkler ringmaster at midnightcircus.com
Thu Jun 22 16:31:27 GMT 2006


Robert Deaton wrote:
> Would it not make sense for us to make these actions, and all other
> similar inconsistancies and duplications, in some way standardized so
> that we're not doing so many things and searching through so many
> pieces of code? Even if we have to do two checks, one on $_POST for
> ajax and one on $_GET for everything else, at least having common
> names that are somewhat documentable would be nice. Thoughts?
> Comments?

I might misunderstand your question, because I think it is compound. 
Let me see if I've got it:

You want to disambiguate plugin hook names. (pre_add_post, 
ajax_pre_add_post, etc.)
AND
You want any action in which a hook executes (most of them, anyway) to 
have pre and post hooks with valid data available to them.

If I've got that right, then what's your suggestion for solving it?

For posts, it seems simple enough (without looking at any code to verify 
it) to add some hooks around the new-ish add/update/delete post 
functions.  One of the primary things I would like to be able to to with 
pre hooks is to cancel the impending action without bailing completely 
from the script (aka using die()).  Too much to ask, probably, and I 
should just stick to suggesting canceling actions alone.

Owen




More information about the wp-hackers mailing list