WordPress Hooks WordPress Hooks wordpress wordpress

WordPress Hooks


Basically, it maintains a global variable called $wp_filter to hold relevant data. Plugins can use functions like add_filter() to get themselves registered.

At various points (the hook points), wordpress examines $wp_filter to see if there are filters to run.

The easiest way to figure it out is to take a look at wp-includes/plugin.php and study the code there (or hook up a debugger and step through it, or set up firePHP and periodically dump stuff out)

I'm no expert, but I was curious, so I took a peek. If I really wanted to know more, I'd do what I just suggested.


if you have experience with any event driven programming like .net etc .. u must be aware of events .. consider these hooks as events as well ... a plugin registers the events it want to fire a function on and the event object remembers that .. and then when that event is fired from somewhere in WP .. it goes through the array to find the functions which it needs to call for that specific event.