[wp-trac] [WordPress Trac] #49496: filters missing for get_header and get_footer
WordPress Trac
noreply at wordpress.org
Sun Feb 23 13:44:23 UTC 2020
#49496: filters missing for get_header and get_footer
--------------------------+-----------------------------
Reporter: kevdotbadger | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: trunk
Severity: normal | Keywords:
Focuses: template |
--------------------------+-----------------------------
Seems like a minor thing that has quite a big impact. The preferred way to
load different headers and footers is to use the $name argument in
get_header() and get_footer().
This works fine. However, modifying them from a plugin, or even from a
theme when logic decides which is loaded makes them get messy quite
quickly.
A solution (which I've used), is to set the $name argument to a 'global'
variable in my functions.php file and then use that thoughout my theme.
When I need to conditionally set the header/footer I simply update that
variable.
Surely a filter for both get_header() and get_footer(), would be a better
solution?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49496>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list