Opened 12 years ago
Closed 11 years ago
#28045 closed feature request (duplicate)
Passing variables to header
| Reported by: | gallantfish | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Themes | Version: | 3.8.3 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | template |
Description
I'd like to pass variables to get_header() so I don't have to add extra formatting to get the header to behave / look different when the only change is the template.
I don't want to create a new header just to add a class, nor detecting the template just to add a mobile version of the menu to the header.
The cleanest way to do it, when only ONE thing triggers everything (a different template is selected) is by get_header() accepting variables.
I have presented in previous feature requests future scenarios which became true in the next two years (as wp enhancements or successful plugins), and I was attacked, so excuse me if I don't present many cases now, in which this request would save us lots of time.
I just don't remember them all the scenarios to open your mind to the possibilities without you having your own brainstorming, but I see previous people asking for this and they were just suggested alternate solutions (i.e. adding extra code and steps to accomplish the single usage they proposed).
Thanks.
Change History (2)
#2
@
11 years ago
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
Duplicate of #21676.
We aren't going to alter the existing funcs to take $data, but it's possible that a new API could be created that takes a template and data. The main issue here: all templating languages take a template or template name AND data. We are in a weird spot, because we use raw PHP for templating.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #21676