[wp-trac] [WordPress Trac] #10408: Standard Naming of Hooks in Themes
WordPress Trac
wp-trac at lists.automattic.com
Wed Jul 15 18:45:15 UTC 2009
#10408: Standard Naming of Hooks in Themes
-------------------------+--------------------------------------------------
Reporter: dcole07 | Owner: dcole07
Type: enhancement | Status: accepted
Priority: normal | Milestone: 2.9
Component: Themes | Version: 2.9
Severity: normal | Keywords: close
-------------------------+--------------------------------------------------
Comment(by Denis-de-Bernardy):
Yaya, it's perfectly clear you want new hooks. I was merely mentioning how
these hooks ended up used in practice when theme authors add them.
Quite frankly, having gone through this myself, and having maintained a
template that had tons of hooks at one point while keeping other themes in
mind for my plugins, the only hooks I've ever wished was present on all
installs were a wp_header hook immediately after the body tag. Then again,
they can easily be replaced by hooking into wp_head.
The remaining bonus hooks in themes you're wishing for, are really just a
convenience for end-users who don't understand the WP internals. Yet, I
can tell you with reasonable confidence that there almost always is a non-
obvious hook that can be used in a way or another.
Adding to this, my key finding -- if any -- was that having too obvious
hooks in a template was bait for end-users to try to use them, for all
sorts of things that they shouldn't even be trying. The last thing you
want is Joe six-pack's mom requesting help in a support forum in order to
code a php function. I speak from experience here, too -- I've helped
hundreds of them, and dealing with them is not fun *at all*.
The most important point to keep in mind, though, is that a lot of themes
don't go as far as adding the wp_footer() call. If we add a half dozen
more such things, you're guaranteed that plugins will advertise themselves
as being click and do nothing things -- but the reality is going it's
going to be chaos in the support forum because they still have to do
something.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10408#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list