[wp-hackers] Way to tell what hooks are supported

Mark Jaquith mark.wordpress at txfx.net
Fri Aug 12 22:42:47 GMT 2005


David Chait wrote:

> I don't understand the concept of 'all the hoks that are supported'.  
> Do you mean 'all the hooks that are called internally by WordPress'?
>
> Obviously, there are a number of hooks that are called from within 
> templates/themes, and none of those would necessarily be 'advertised' 
> (as it'd be improper to do so).  Also, just because a hook is 
> advertised doesn't guarantee it is getting called upon -- that could 
> also depend on the page, or the template.  Sticky issue...
>
> I mean, otherwise, this is sort of like querying OpenGL for 'what 
> extensions are supported'... So I'm all for it, just think in 
> real-life coding it will only be of use in certain circumstances.

Yes, all the hooks that are called internally by WordPress.  There are 4 
hooks in the templates themselves.  Header, Sidebar, Comment Form, 
Footer.  The rest are all in WP.  And obviously certain hooks aren't 
called all the time... the feed ones only get called on feeds, etc.  
This isn't supposed to say which feeds are going to be called in this 
run, but what hooks are generally available in this build of WordPress.  
Sometimes when you are designing a plugin, you want to do things one way 
if one hook is supported, and another way if it is not supported.  This 
will tell you if the hook you need is present in the version of 
WordPress you are dealing with.  Yeah, it has limited use, but there 
have been definite times I could have benefited from it, and I know 
other plugin authors who could have used it as well.


More information about the wp-hackers mailing list