[wp-trac] Re: [WordPress Trac] #8884: Bug In wp_enqueue_script() In Footer

WordPress Trac wp-trac at lists.automattic.com
Mon Jan 19 09:45:12 GMT 2009


#8884: Bug In wp_enqueue_script() In Footer
--------------------------+-------------------------------------------------
 Reporter:  GamerZ        |        Owner:  azaozz
     Type:  defect (bug)  |       Status:  new   
 Priority:  high          |    Milestone:  2.8   
Component:  JavaScript    |      Version:  2.8   
 Severity:  normal        |   Resolution:        
 Keywords:                |  
--------------------------+-------------------------------------------------
Comment (by azaozz):

 1. "wp_print_scripts" is the "global" hook for adding scripts, it leaves
 to the plugin author to decide when to print the script. It is being
 deprecated by `do_action('admin_enqueue_scripts', $hook_suffix);` that
 runs in the admin head only, perhaps we can add "wp_enqueue_scripts" that
 would run in the client side only.

 A lot of plugins seem to use "wp_print_scripts" for both the admin and
 client sides, so it will take time for this to be adopted.

 2. Yes, that seems to be the logical solution for adding footer scripts to
 the client side. Unfortunately a lot of themes don't call `wp_footer()`.
 We can encourage that, even ask the users to paste `<?php wp_footer(); ?>`
 just above the `</body>` tag in their theme. However some plugins use this
 hook to output HTML and the users may not expect that.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8884#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list