One of the most important things you can do to improve your WordPress skills is to learn all about WordPress hooks. If you’ve spent any time looking through code, trying to write a plugin, or referencing the Codex then you likely know:
Hooks are provided by WordPress to allow your plugin to ‘hook into’ the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion.
Yes, I think it’s important to understand the event-driven design pattern. And it’s one thing to have a comprehensive list of everything that’s available regardless of if it’s an action or a filter but it’s another thing to actually see it action.
Given that we all have different learning styles, sometimes I think having a reference is only one way to go about learning how to leverage the system. Another way would be to use a plugin like Hookr.
Improve Your WordPress Skills
Late last year, WP Tavern provided a great article on the plugin that goes into detail about the state of the plugin and plans for the year. It’s worth a read if you have the time.
But the point in my bringing it up doesn’t so much have to do with the news around the plugin, but it’s how it can help you improve your WordPress skills.
When talking with other people who have been working with WordPress or who have just begun to work with WordPress, the hook system clicks for them in different ways and at different times in their work.
Sometimes, they get that moment of clarity at some point during different. Other times, they get it just after reading the documentation. For those who are more experienced programmers and who have familiar with the event-driven design pattern, they’re already familiar with how the system works – it’s just a matter of knowing the names of the hooks.
And since there are different types of learning, it’d stand to reason that a plugin like this could help others learn about hooks and the system more quickly than when reading docs.
Here’s how it works:
- Install the plugin and activate it,
- Load up any given page in your WordPress theme,
- You’ll be presented with all of the hooks that have fired on the page in the order in which they fired,
- You’ll have the ability to hover over the hook’s name to see its description and value.
Personally, I’ve found that it’s a solid reference especially when I’m in the middle of working on a project and don’t want to spend too much time hopping in and out of various windows, browser tabs, and so on.
Furthermore, the fact that it exposes hooks for themes and plugins has also helped me get a better handle on some of the lesser known hooks which have allowed me to build some small utility plugins that I would’ve had to dig through source code to find.