[wp-trac] [WordPress Trac] #42730: Allow wp_enqueue_scripts() for URLs with parameters

WordPress Trac noreply at wordpress.org
Tue Nov 28 14:05:24 UTC 2017


#42730: Allow wp_enqueue_scripts() for URLs with parameters
-------------------------------+------------------------------
 Reporter:  MattyRob           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Script Loader      |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  javascript
-------------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => reporter-feedback
 * type:  enhancement => defect (bug)
 * version:  trunk =>
 * component:  General => Script Loader


Comment:

 The encoding of the ampersand looks valid to me. Using the following code,
 the script is enqueued and loaded by the browser correctly.

 {{{
 add_action( 'wp_enqueue_scripts', function() {
         wp_enqueue_script( 'core-42730',
 'https://api.ipify.org?format=jsonp&callback=getip' );
 } );
 }}}

 Results in a valid script tag:

 {{{
 <script type='text/javascript'
 src='https://api.ipify.org?format=jsonp&callback=getip&ver=4.9'></script>
 }}}

 @MattyRob What problem are you seeing exactly?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42730#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list