n the recent Hybrid 0.7 survey, I asked about action and filter hooks in the theme. This was the least-answered question because most people don’t have to use hooks or have no idea what they are. It’s more of a developer feature (though not limited to developers). The question was:
What new hooks (filter hooks and action hooks) need to be implemented within the theme? Where? Why?
In this post, I’ll run through some of the answers and give my reply.
Include options for hooks in the admin panel
This is not a bad idea at all. I wonder why I didn’t think of that.
Seriously, there’s already two plugins that do this — Hybrid Hook and Hybrid Hook Widgets. The former gives you admin screen with tons of options. The latter adds widget areas to several select action hooks. I encourage you to give them a try.
I don’t like the idea of this as part of the core theme though. Hybrid is meant to be a lightweight framework, which should be extended through things such as plugin and child themes. It’s not supposed to be a powerhouse, all-in-one package.
I’d like to see a “inside content hook”
WordPress already has one for you. It’s
the_content and is used by many, many plugins and themes.
More comment area hooks
I definitely agree that the comments template and functions related to it need more hooks, especially filter hooks. In fact, it’s one of the first things I brought up in the Hybrid 0.7 discussion thread.
I could really use some more feedback on what hooks you want to see here. Feel free to post your ideas in the comments or the 0.7 discussion thread.
A visual overview of the hooks
This probably belongs under the documentation question, but it’s definitely something we need. I’m currently working on this and will be adding it to the hooks documentation as soon as possible.
I have no idea what this means.
This is definitely my favorite answer. Hooks are a way for you to add custom content to WordPress, the Hybrid theme, and some plugins without touching the core code. This allows you to easily keep up with upgrades without losing your customizations.
The truth is that not everyone needs to know how to use the WordPress hook system. It’s mainly for developers. But, if you really want to learn a little and customize your blog to your heart’s content, you need to learn the basics. Hooks, especially action hooks, are simple to use.
Here’s some resources for using the action and filter hooks in Hybrid:
- Hooks Documentation
- Hybrid Hook Plugin
- Hybrid Hook Widgets
Even though the survey is now over, feel free to leave additional comments about action and filter hooks you’d like to see. I’m always open to suggestions.
Stay tuned for the next post on the survey results. I’ll be covering what you all consider “flaws” in the current Hybrid theme.