[wp-trac] [WordPress Trac] #21506: Standard Theme Hooks
WordPress Trac
noreply at wordpress.org
Fri Feb 22 18:25:59 UTC 2013
#21506: Standard Theme Hooks
---------------------------+------------------------------
Reporter: mfields | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: |
---------------------------+------------------------------
Comment (by chipbennett):
Replying to [comment:63 greenshady]:
> One way we can cut down on themes implementing these hooks is to add an
"after" hook to match these:
>
> * `get_template_part_{$slug}`
> * `get_header`
> * `get_footer`
> * `get_sidebar`
> * `get_searchform`
>
> Using these would be good for several reasons.
>
> * Themes don't need to alter their code.
> * Most of these hooks are used across nearly all themes.
> * We'd be building something off existing core hooks and functions.
> * We can cut way back on additional functions for outputting hooks.
> * The only hook we'd really need to consider adding to themes is the one
for post data. See: #18561
I love this idea, but it doesn't address semantic template locations.
For example: `get_header` and `get_header_after` would not provide enough
resolution to hook into the site header/masthead/whatever-we're-calling-
it-now. The `get_header` hook would fire before the HTML document head,
and `get_header_after` would fire, usually, either right before or right
after the opening main-content container.
Same thing with `get_footer` and `get_footer_after`. The former would fire
either right before or right after the closing main-content container, and
the latter would fire after the closing `</html>` tag.
I agree that the hooks would be helpful, but I don't think they would
solve the issue of Themes defining semantic template locations.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21506#comment:65>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list