[wp-trac] [WordPress Trac] #59865: wp_enqueue_script problem

WordPress Trac noreply at wordpress.org
Thu Nov 9 11:49:22 UTC 2023


#59865: wp_enqueue_script problem
---------------------------+-----------------------------
 Reporter:  jareksol       |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Script Loader  |    Version:  6.4
 Severity:  major          |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 After upgrade to 6.4.1 version I have a problem with printing scripts tag
 in footer.
 My code is very simple:
 {{{
 wp_enqueue_script('sage/home.js', asset_path('scripts/home.js'),
 ['jquery'], null, true);
 }}}

 The output is:

 {{{
 <script type="text/javascript" src="https://mysite.dvl.to/wp-
 content/themes/sage/dist/scripts/home_58192a8e.js' defer='defer"
 id="sage/home.js-js"></script>
 }}}
 The result is script is not loading.

 I have found temporary solution in wp-includes/class-wp-scripts.php file.
 I have commented line 412 which is:

 {{{
 $src = esc_url_raw( apply_filters( 'script_loader_src', $src, $handle ) );
 }}}

 Can you please fix this bug?

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


More information about the wp-trac mailing list