Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#19965 closed enhancement (wontfix)

Add *standard* custom field page-header-code

Reported by: sooskriszta Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Template Keywords:
Focuses: Cc:


Add a *standard* custom field page-header-code to the pages/posts.

Themes that want to support this function, can use this field to insert the code in this field into the header for the page.

WordPress can leave this field blank.

While some users might use this field to define page-specific headers, css, etc, the real utility of the field would be in that plugins like bbPress, BuddyPress, All-in-One Event Calendar, etc could insert header code to the pages they generate.

This simple addition will enable WordPress plugin developers to make their plugins much more powerful and flexible.

Change History (3)

#1 @scribu
4 years ago

  • Keywords reporter-feedback added

What exactly is a "page-header-code" ?

#2 @sooskriszta
4 years ago

I just used a random name.

Essentially, there would a variable, I'm calling it page-header-code, in implementation it could be called something else.

The purpose would be that anything stored within this variable (typically code, css, javascript, meta tags etc) will be output into the code between <head></head> tags on the page.

WordPress just needs to provide this variable as standard. And to include this in documentation.

Plugins can then populate the variable. Or users can manually do that.

And themes can read the value and spit it out into <head></head>

Last edited 4 years ago by sooskriszta (previous) (diff)

#3 @scribu
4 years ago

  • Component changed from Database to Template
  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
  • Type changed from feature request to enhancement

WordPress has a much more elegant way of doing this: it's called the 'wp_head' action:


Note: See TracTickets for help on using tickets.