[wp-hackers] Looking for quick input on creating new action hooks...

Matt Mullenweg m at mullenweg.com
Sat May 28 01:02:15 GMT 2005


David Chait wrote:
> ...Or something along those lines.  The concept is actions that (in 
> future templates, or added to current ones) would execute inside the 
> post DIV, one right at the start, one right at the end.  I'm working on 
> plugins that allow you to insert custom content into The Loop without 
> editing the template, and figure why have people call a custom function, 
> when they could just have do_action('wp_post_out_end');   Y'know what I 
> mean?  Seems like sprinkling new action hook locations is more useful 
> than adding another function call directly because:

Even with the simple hooks we have already in the templates, lots of 
plugin authors have had to deal with the hooks not being there because a 
theme doesn't contain them. It's also a slippery slope to go down, in 
theory we could have a hook between every HTML element on the page, but 
that'd be pretty silly.

A better solution might be...

Scan the plugin file for function definitions, then scan the templates 
and warn the user before actually deactivating the plugin that there are 
still function calls in their templates.

-- 
Matt Mullenweg
http://photomatt.net  | http://wordpress.org
http://pingomatic.com | http://cnet.com


More information about the wp-hackers mailing list