WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#8859 closed defect (bug) (fixed)

Load JavaScript In Footer On Specific Pages Using "admin_footer-$hook_suffix"

Reported by: GamerZ Owned by: azaozz
Milestone: 2.8 Priority: high
Severity: normal Version: 2.8
Component: JavaScript Keywords: javascript
Focuses: Cc:

Description

In admin-header.php we have can specify which page to load plugin's JavaScript as well as CSS Stylesheets

do_action("admin_print_styles-$hook_suffix");
do_action("admin_print_scripts-$hook_suffix");
do_action("admin_head-$hook_suffix");

In WordPress 2.8, with the major JavaScript changes and the recommendation to load JavaScript in the footer, I think we need that above line of code for the admin_footer as well so that plugins can load their respective JavaScript as well as CSS on their pages only.

do_action("admin_footer-$hook_suffix");

Change History (1)

comment:1 @azaozz7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10362]) Add action hook in admin footer so plugins can output scripts there on specific pages only, props GamerZ, fixes #8859

Note: See TracTickets for help on using tickets.