[wp-trac] [WordPress Trac] #27407: wp_enqueue_scripts: jQuery loads in head despite of being included as dependency of another footer script

WordPress Trac noreply at wordpress.org
Fri Mar 14 00:59:56 UTC 2014


#27407: wp_enqueue_scripts: jQuery loads in head despite of being included as
dependency of another footer script
---------------------------+-----------------------------
 Reporter:  Marventus      |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Script Loader  |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 I reported this problem here (#22244), but since it is not the exact same
 problem and the ticket in question is over a year old, I thought I should
 create a new ticket.
 Using latest wp-trunk version, TwentyTwelve theme and no plugins
 installed, the following script registration procedure fails to load
 jQuery in the footer:
 {{{
 function tgi_jquery_in_footer_test() {
     wp_register_script('tgi-jquery-js', "//some-uri/name.js",
 array("jquery"), "0.1", true);
     wp_enqueue_script('tgi-jquery-js');
 }
 add_action('wp_enqueue_scripts', 'tgi_jquery_in_footer_test');
 }}}

 Even re-registering jquery with the same options and in_footer param set
 to true doesn't seem to cut it:
 {{{
 function tgi_jquery_in_footer_test() {
     wp_deregister_script("jquery");
     wp_register_script("jquery", false, array("jquery-core", "jquery-
 migrate"), "1.11", true);
     wp_register_script('tgi-jquery-js', "//some/uri/name.js",
 array("jquery"), "0.1", true);
     wp_enqueue_script('tgi-jquery-js');
 }
 add_action('wp_enqueue_scripts', 'tgi_jquery_in_footer_test');
 }}}
 Could anyone try to replicate this?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27407>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list