[wp-hackers] Bug: admin_head called early

Peter Westwood peter.westwood at ftwr.co.uk
Fri Apr 13 21:51:13 GMT 2007


Elliotte Harold wrote:
> 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 "-//W3C//DTD XHTML 1.0 
> Transitional//EN" 
> "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.
> 

Please can you supply example code that demonstrates this issue.

Reviewing the code in question sheds no light on the problem

Cheers

westi
-- 
Peter Westwood
http://blog.ftwr.co.uk


More information about the wp-hackers mailing list