Opened 13 years ago
Closed 9 years ago
#20287 closed enhancement (wontfix)
Load header and footer template files using hooks
Reported by: | johnbillion | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.5 |
Component: | Themes | Keywords: | has-patch |
Focuses: | template | Cc: |
Description
The theme header and footer files are loaded from inside the get_header()
and get_footer()
functions.
If these files were instead loaded from helper functions that were hooked into actions inside get_header
and get_footer
then we'd get two nice benefits:
- Theme frameworks that call a function or fire an action immediately after the header would be able to use the hooks instead of placing the calls directly in each file. For example, Thematic calls
thematic_abovecontainer()
in each template file immediately afterget_header()
. It could instead add this via a hook. - Fancy schmancy themes or plugins that add partial-page AJAX loading (using a system such as PJAX) could unhook the header and footer when they're unneeded in AJAX requests.
Patch coming up.
Attachments (2)
Change History (9)
#6
@
10 years ago
20287.1.diff looks incomplete, @MikeHansenMe.
@johnbillion: Should the get_(header|footer)
action be moved inside the load functions? They're currently being used in a context where template loading happens immediately afterwards. I'd also suspect that in most cases where you wouldn't want header of footer to be loaded, you wouldn't want these actions to fire either.
Note: See
TracTickets for help on using
tickets.
Patch. I might not have explained the use cases above very well. If it needs clarifying please let me know.