-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: Hook into a specific theme's existing hooks #11
Comments
I'd actually spoken to Nathan Rice about this in re: Genesis eventually supporting such a thing. A shim plugin such as the one you suggest is actually a good idea. Hmm. How best to formalize it, though? |
I finally got to the point where I could properly add this into Opus Primus (soon to be released WordPress theme). Here is a link to the gist "bridge" https://gist.github.com/Cais/4719335 ... if nothing else it can serve as a starting point for formalization discussions? |
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 |
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
tha-theme-hooks.php
code a commented out line after each function to hook the THA supported hook into an existing theme's hook, for example: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 text was updated successfully, but these errors were encountered: