Join GitHub today
Idea: Hook into a specific theme's existing hooks #11
Just a thought/idea to help make this idea more palatable to theme developers already using their own hook system / architecture. Using an example snippet:
I suggest adding to the
This works in practice but I will leave it to you to decide if you want to make it obvious to others. Of course, this would also be unique for each theme that implements this idea.
I plan to add something like this as an enhancement plugin for my latest theme.
The way I implemented this in Oenology, since I already had template-tag functions in the template, that fired the custom Theme template hooks (such as
I just finished refactoring all of my action hooks to the same "format" of < namespace >-< function >-< location > where < function > can be whatever and location is either top/bottom or before/after. Which mean my "bridge" now is simply using
If WordPress core adopts these, I will simple write an appropriate "bridge" for those hook names in the same manner I added the THA hooks. The only thing to be considered with either of these methods is without a priority being set specifically they will fire in their order of definition.
I intend to go back and look at the