[wp-trac] [WordPress Trac] #21782: admin_print_footer_scripts action not working with wp_enqueue_script function

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 3 21:45:47 UTC 2012


#21782: admin_print_footer_scripts action not working with wp_enqueue_script
function
----------------------------+------------------------------
 Reporter:  alexvorn2       |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.4.1
 Severity:  normal          |  Resolution:
 Keywords:                  |
----------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:  2nd-opinion needs-patch =>


Old description:

> the code I use:
>
> function tt() {
>         wp_enqueue_script('jquery-ui-accordion');
> } add_action('admin_print_footer_scripts', 'tt');
>
> the jquery-ui-accordion is not loaded in the footer.

New description:

 the code I use:
 {{{
 function tt() {
         wp_enqueue_script('jquery-ui-accordion');
 } add_action('admin_print_footer_scripts', 'tt');
 }}}
 the jquery-ui-accordion is not loaded in the footer.

--

Comment:

 `admin_print_footer_scripts` is too late for enqueueing. This is when
 `_wp_footer_scripts()` is called, so only the styles included earlier will
 be printed.

 Use `admin_footer` instead.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21782#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list