Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4146 closed defect (bug) (invalid)

admin_head fires too early

Reported by: elharo's profile elharo Owned by: westi's profile westi
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Administration Keywords: reporter-feeback
Focuses: Cc:

Description

The admin_head hook is documented as:

Executes in the <head> section of the admin panel. Useful for insertion of additional content.

However I think it actually fires early, before the head. I'm seeing output like this when I hook into it:

<style type="text/css">#ed_lookup, #ed_spell { display:none; } </style>

<script type='text/javascript'>

var emButton = document.getElementById('ed_em')
emButton.setAttribute('value', 'em')

</script> <!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Mokka mit Schlag &rsaquo; Create New Post &#8212; WordPress</title>
<link rel="stylesheet" href="http://www.elharo.com/blog/wp-admin/wp-admin.css?version=2.1.3" type="text/css" />
...

The first style and script element are from my nascent plugin. Notice that they show up before the DOCTYPE and root element. They should show up in the head element after the <head> start-tag.

Change History (3)

#1 @westi
17 years ago

  • Keywords reporter-feeback added
  • Owner changed from anonymous to westi
  • Status changed from new to assigned
  • Version set to 2.2

admin_head fires after the head section content has been sent but before </head> -> http://trac.wordpress.org/browser/trunk/wp-admin/admin-header.php#L42

Please can you supply example code that demonstrates this issue.

Reviewing the code in question sheds no light on the problem

#2 @westi
17 years ago

  • Resolution set to invalid
  • Status changed from assigned to closed

Bug in plugin code not hooking on admin_head but admin_menu instead.

http://comox.textdrive.com/pipermail/wp-hackers/2007-April/011890.html

#3 @foolswisdom
17 years ago

  • Milestone 2.4 deleted
Note: See TracTickets for help on using tickets.