[wp-trac] [WordPress Trac] #12563: New action on body open
WordPress Trac
noreply at wordpress.org
Tue Aug 27 00:54:58 UTC 2013
#12563: New action on body open
-----------------------------------------+-----------------------------
Reporter: joostdevalk | Owner: joostdevalk
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Themes | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion close |
-----------------------------------------+-----------------------------
Comment (by Willscrlt):
Replying to [comment:21 obenland]:
> Can we close this in favor of #21506?
Hi. I agree with joostdevalk. This hook is very necessary for several
people (at least judging by the number of similar requests I found when
Googling this). The other ticket has some similarities, but nothing like
this where the hook comes right after the BODY tag.
That, too, is what I need. I realize that not all themes will support it
(though getting it into the next updates of the TwentyEleven,
TwentyTwelve, and TwentyThirteen themes would be a big boost), but it
would be a lot easier for users to pick themes that support the hook (or
add one line of code to a theme), than for plugin developers to have to
resort to really ugly JavaScript kludges that only work if JS is enabled.
In my case, I am writing a plugin that easily (or so I thought) allows
people to call a PHP function at the top of the page. I will be using it
on my own sites to load a global navigation bar across multiple domains
and multiple Web applications (WordPress, phpBB, Piwigo, etc.). I need
something that works across multiple themes (at least any theme that has
built in support for the new body_open hook), since different sites use
different themes.
Sure, I could hack existing themes to insert the PHP function, but I'd
rather just use a plugin to do it, and then leave the themes alone so that
they can remain updated and my function still works.
The need for body_open is definitely there, so I hope that this will be
committed quickly. As far as waiting for theme support--well--nobody is
going to support it until it becomes a reality. Even if adoption is slow,
that doesn't mean it's useless. If a Webmaster needs the functionality of
a plugin like mine (or any of the others I've seen suggested by people
looking for this fix), then they will find a theme that works or hack one
to make it work.
I have no idea about the politics or proper procedures of getting a commit
like this done, but the Codex does imply that if we find places that need
new hooks, it will be easy to get them added. I took that with a grain of
salt, but this suggestion has been around for 3 years. Can we PLEASE get
it in the next release? It doesn't seem like it should be that hard to add
a hook in.
And just to be clear, this needs to come BEFORE any other WP stuff (right
after the body tag would be best for me and for the others I read). #21506
would come after all the top visual headings. That would be far too late
for what most of us need. Not that that isn't a good place for a hook,
too. It's just not the same thing. Thanks!
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12563#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list