themehookalliance icon indicating copy to clipboard operation
themehookalliance copied to clipboard

Replace 'tha' with a constant

Open felixarntz opened this issue 11 years ago • 2 comments

http://yoast.com/standard-wordpress-theme-hooks/

The idea for it actually comes by Yoast. But I also think that would be very useful:

The tha prefix on all the hooks is kinda like a branding, and many people I know wouldn't like to see something like this in their own themes (except when it's wp). So why not use a constant for that, like in the linked post?

WP_THEME_NAMESPACE could be the name, and each theme developer would have to define this variable (in a conditional statement to allow child-theme developers to override it if they choose to replace all the hooks). In the file tha_theme_hooks.php a fallback (also in a conditional statement of course) could be placed which would then hold the name tha. This change would not make any functional difference, but I think more people would be using it.

I would happily make a pull request for that, but first I would like to hear about what you think.

felixarntz avatar Jan 24 '14 12:01 felixarntz

@felixarntz: Interesting idea. I think we've approached it from the opposite view: individual themes would support THA hooks.

Your convention has some merit, but would you mind expanding on it a bit further?

zamoose avatar Feb 10 '14 02:02 zamoose

Like I said, using a "neutral" constant will not evoke some kind of branding impression. I created a repository with my own ideas, maybe you can check that out. I hope you don't feel like I want to compete with THA, I just thought it would be useful to keep my thoughts in this. https://github.com/felixarntz/wp-theme-standardization-panel

If you like some ideas there, maybe we can somehow merge our two projects into one that's even better - I'm excited what you think.

felixarntz avatar Feb 11 '14 22:02 felixarntz