Skip navigation

WordPress Hooks – All of Them

WordPress Hooks from Flat Earth is an amazing project to list all of the hooks in WordPress, from version 1.5 to 2.0. The WordPress Hooks project was initiated by Mark Jaquith, with a lot of help from WordPress developers and volunteers.

A hook is an anchor point which a plugin or javascript can use to literally grab onto, creating actions and interactions within the code for the plugin. Think of hooks this way, as described on WordPress Hooks:

An example would be when I posted this entry publish_post was fired, and passed along the ID of this post. Plugins could use that ID to do things related to this entry, and pass on the ID for other plugins, but after all the plugins have run, the information passed along (the ID) is thrown away. Actions also have the possibility of not passing on any information (“No Parameters” hooks). These are hooks that are merely placeholders… like a template header or an admin footer. These are the only hooks whose functions should not return any information. Important note: actions are not all “No Parameters” hooks! It is still important to return any information you may get when using an action hook… even though WordPress won’t be using it, other plugins might!

The list is not totally complete. There are still many hooks which are yet to be documented, and experts in WordPress plugins, API, and hooks would be appreciated to help fill in the blanks. There is another related list on the WordPress Codex called WordPress Function Reference.

If you write WordPress plugins, or are thinking about it, this is an invaluable resource.


Site Search Tags: , , , , , , , , , , , ,
Copyright Lorelle VanFossen

One Comment

  1. Posted February 11, 2008 at 5:36 pm | Permalink

    I’ve started a new hooks directory on my site. I had two motivations. First, the Flat Earth project seems largely abandoned. Second, neither the codex nor Flat Earth provided version information.

    My new hooks database scrapes the WP code using some carefully crafted regular expressions. As such, it finds all the hooks in every version of WP, and it can tell you when a hook was introduced or deprecated. And since it’s an automated process, the database is always up to date. Well, I update it as soon as I notice a new release of WP–after that, updating takes only two minutes.

    Feel free to publicize it if you want. Other WP users have already linked to it from the codex, but I’m sure there are some plugin authors who won’t notice that for a while. Here’s the URL:

    http://adambrown.info/p/wp_hooks


10 Trackbacks/Pingbacks

  1. [...] WordPress, in addition to the hooks and the template functions, supports pluggable functions – a simple yet efficient way of changing behavior of WordPress. [...]

  2. [...] WordPress Hooks – All of Them [...]

  3. [...] Javascript can be included in WordPress posts as well as in WordPress Themes, it just needs some special handling. Javascripts from within the posts need to be called in from external files as WordPress formatting can strip away all the code, making the Javascript not function. Many WordPress Plugins include Javascript, and they embed the scripts and script callouts into your WordPress Themes using the many WordPress hooks. [...]

  4. [...] WordPress Hooks – All of Them [...]

  5. [...] in addition to the hooks and the template functions, supports pluggable functions – a simple yet efficient way of changing [...]

  6. […] WordPress Hooks – All of Them […]

  7. […] WordPress Hooks – All of Them […]

  8. […] WordPress Hooks – All of Them […]

  9. […] WordPress Hooks – All of Them […]

  10. […] WordPress Hooks – All of Them […]

Post a Comment

Follow

Get every new post delivered to your Inbox.

Join 20,275 other followers

%d bloggers like this: