[wp-trac] Re: [WordPress Trac] #9346: wp_enqueue_script() doesn't work mid-page for footer scripts

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 3 01:26:54 GMT 2009


#9346: wp_enqueue_script() doesn't work mid-page for footer scripts
--------------------------+-------------------------------------------------
 Reporter:  Viper007Bond  |       Owner:  azaozz        
     Type:  enhancement   |      Status:  new           
 Priority:  lowest        |   Milestone:  Future Release
Component:  JavaScript    |     Version:  2.8           
 Severity:  minor         |    Keywords:  needs-patch   
--------------------------+-------------------------------------------------

Comment(by hakre):

 Replying to [comment:2 Viper007Bond]:
 > Debugged and found the problem.
 >
 > When `WP_Scripts::do_item()` fires for outputting the header scripts and
 comes across a script that is meant for the footer, it tosses that that
 handle into the `WP_Scripts::in_footer` array and aborts outputting it.
 >
 > Calling `wp_enqueue_script()` after that point doesn't add the script to
 the `WP_Scripts::in_footer` array, so it never gets properly registered.
 >
 > I have a couple solutions in mind, but I'll let someone more at home
 with the class (azaozz perhaps?) come up with the solution to ensure it's
 the cleanest one.

 thanks for getting into it. a propper dev feedback would be nice, because
 as you I think this should be easily solveable.

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


More information about the wp-trac mailing list