Support » Developing with WordPress » 4.8.1 enqueue script version problem

  • Resolved jodayeah

    (@jodayeah)


    Hi guys,

    since updating to 4.8.1 I am having a problem with my enqueued scripts. This is how I try to load isotope script in a custom plugin:

    function isotope_plugin() {
    	wp_enqueue_script('isotope', 'https://unpkg.com/isotope-layout@3.0/dist/isotope.pkgd.js', array('jquery'), false, false);
    }
    
    add_action( 'wp_enqueue_scripts', 'isotope_plugin' );  

    However I get an error because the script can’t be found. I checked and this is because my current WordPress version 4.8.1 gets added to the script src so that it reads “https://unpkg.com/isotope-layout@3.0/dist/isotope.pkgd.js?ver=4.8.1”. That is although I specifically asked to add no version number. The same happens if I just define the handle and the src like so

    
    function isotope_plugin() {
    	wp_enqueue_script('isotope', 'https://unpkg.com/isotope-layout@3.0/dist/isotope.pkgd.js');
    }
    
    add_action( 'wp_enqueue_scripts', 'isotope_plugin' );  

    I can’t seem to get rid of the Worpdress version number.
    This happens with all scripts I enqueue through this plugin.

    • This topic was modified 1 month, 1 week ago by  jodayeah.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.