[wp-trac] [WordPress Trac] #12563: New action on body open
WordPress Trac
noreply at wordpress.org
Wed Mar 20 02:18:49 UTC 2019
#12563: New action on body open
-------------------------------------------------+-------------------------
Reporter: joostdevalk | Owner:
| adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Bundled Theme | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch commit needs-dev-note | Focuses: template
close |
-------------------------------------------------+-------------------------
Comment (by apedog):
I've just read through this entire thread and am frankly baffled. I'm used
to seeing discussion thread around feature requests on different
repositories. And quite a few where the project leads refuse those feature
requests on ideological and design philosophy grounds. Even if those leads
accept that the feature might be useful to a portion of the users.
But this is not the case here. The feature is rejected without any cogent
reason. 'WordPress has survived for 8 years without this useful feature'
is given as a valid reason. 'GMT hooking into body tag will soon be a
thing of the past' - another reply. 'Themes will not adopt this' was one
very un-forward-looking argument given (the recent push of Gutenberg being
a clear example to the contrary - plugin developers have rushed to
implement). And finally - 'Gutenberg is coming and it's gonna change
EVERYTHING'. While the last might be true, it is irrelevant to the
necessity of this hook. This has nothing to do with Gutenberg or with
themes, and all to do with plugins that require hooking into the opening
of the BODY tag.
Right now I have a custom {{{<?php namespaced_wp_body() ?>}}} function
that calls 3 different {{{do_action}}} hooks ({{{tha_body_top}}},
{{{body_top}}}, {{{body_open}}}) that all do the same thing, just to
satisfy different plugins I have installed (and, of course, I cannot play
with the priorities properly as the hooks fire consecutively). Not to
mention {{{genesis_before}}} and a ton of other non-standardized hooks
that all do exactly the same thing that *apparently* so many plugins find
useful. But the core development team is somehow not impressed by this
abundance of evidence.
When all that is needed is a simple {{{<?php wp_body() ?>}}} tag that any
theme can easily implement and a standard {{{do_action('body_open')}}}
that any plugin can hook into. @ramiy's post above is illustrative of the
simplicity and logic of implementing this functionality in WordPress core.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/12563#comment:63>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list