Ticket #4077 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Need ability to add namespace to admin screens HTML header

Reported by: jhodgdon Assigned to: rob1n
Priority: normal Milestone: 2.2
Component: Administration Version: 2.1.2
Severity: minor Keywords: has-patch 2nd-opinion
Cc: jhodgdon, rob1n

Description

A certain Google Maps API requires that an additional xmlns attributed be added to the HTML header tag so that Internet Explorer will render it correctly (sigh). While the Theme has control over HTML headers for external viewing, wp-admin/admin-header.php has control over HTML headers for the admin screens, and there is no namespace hook. (The API is being used in both admin and external screens.)

So, I would like to request a hook be added. Patch coming shortly.

I have tested that no behavior changes in 2.1.2 and [5176] when my hook is added, and that my plugin can use the hook to add a namespace. I also verified it was a new hook name.

Attachments

admin-header-php2.diff (0.9 kB) - added by jhodgdon on 04/04/07 02:36:05.
Patch to add namespace hook to admin header
admin-header-php2.2.diff (0.9 kB) - added by jhodgdon on 04/04/07 03:40:57.
New version with better name for action (admin_html_ns - I liked that option)

Change History

04/04/07 02:36:05 changed by jhodgdon

  • attachment admin-header-php2.diff added.

Patch to add namespace hook to admin header

04/04/07 03:13:20 changed by rob1n

  • owner changed from anonymous to rob1n.

Maybe a more descriptive filter name? Such as admin_header_ns or admin_html_ns?

Just wondering, seeing as admin_ns isn't very descriptive. Maybe even do "namespace" instead of abbreviating it to "ns."

04/04/07 03:13:27 changed by rob1n

  • cc changed from jhodgdon to jhodgdon, rob1n.

04/04/07 03:35:53 changed by jhodgdon

I was following the convention of the other namespace actions, such as atom_ns, rdf_ns, etc.

04/04/07 03:39:39 changed by jhodgdon

That said, I would be happy to have the name be something else... the existing convention is not great.

There are unfortunately precidents for both inconsistencies and cryptic names... at least I have the ones in 2.1.2 now documented at http://codex.wordpress.org/Plugin_API/Action_Reference and http://codex.wordpress.org/Plugin_API/Filter_Reference -- many opportunities to make things more consistent, except for the fact that plugins are probably already using the inconsistent names.

04/04/07 03:40:57 changed by jhodgdon

  • attachment admin-header-php2.2.diff added.

New version with better name for action (admin_html_ns - I liked that option)

04/04/07 04:28:10 changed by rob1n

  • keywords changed from has-patch action IE admin header to has-patch 2nd-opinion action IE admin header.

I do too, but I want to get Ryan's input on this. I'm +1.

04/04/07 04:28:50 changed by rob1n

  • keywords changed from has-patch 2nd-opinion action IE admin header to has-patch 2nd-opinion.

04/04/07 23:38:19 changed by rob1n

I thought about this a bit more, and now I'm going for a new filter name: admin_xml_ns. *Technically* it's XML's namespace, not HTML's. And the NS could specify something that isn't HTML.

04/04/07 23:54:49 changed by rob1n

  • status changed from new to closed.
  • resolution set to fixed.

(In [5181]) Add admin_xml_ns action to <html> in the admin header. Props jhodgdon. fixes #4077

04/05/07 04:49:09 changed by JeremyVisser

If it's XML's namespace, then adding "xml" to the namespace name is a bit redundant, eh?

04/05/07 04:50:14 changed by JeremyVisser

Oh hang on, sorry. I didn't look at the code. admin_xml_ns is the hook name.