Opened 15 years ago
Closed 10 years ago
#15782 closed enhancement (wontfix)
Consolidate header Javascript
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Administration | Keywords: | has-patch needs-refresh |
Focuses: | Cc: |
Description
As a followon to #15781
Currently there is a block of Javascript required on all admin pages, this is stored directly within admin-header.php, and iframe_header(). Unfortunately, when someone changes/adds code to one, the other is not always updated.
This inline Javascript should be moved to a function and printed on a header action in order to reduce code duplication and prevent future issues.
Attachments (2)
Change History (10)
#4
@
14 years ago
Re: press-this.php, see also the wp_tiny_mce and wp_tiny_mce_preload_dialogs calls.
Edit: reference, #15561.
#5
@
14 years ago
- Keywords 3.2-early removed
- Summary changed from Consolodate header Javascript to Consolidate header Javascript
#6
@
14 years ago
At first look the patch seems right, it removes few duplicate lines of HTML and replaces them with two PHP functions. However at closer look it actually adds more code instead of reducing it.
It also seems to loose the $hook_suffix
global which seems to be redundant in the first place as only the $admin_body_class
global is needed in the script. Another weakness is that the patch allows defaults to be overwritten. These JS globals should be consistent and exactly the same as the PHP globals.
Perhaps a better approach is to just output the script as it is in the admin head at the moment, without much PHP processing.
Also wp_iframe().