wp_enqueue_script depenency breaks
-
I placed a javascript file that is common for all multisite blogs in /js directory.
However, its dependent jQuery core is loaded after my javascript file when I wrote:wp_enqueue_script( 'common-js-requiring-jquery', network_site_url() . 'js/common-js-requiring-jquery.js', array( 'jquery' ) );
When I modified my code as follows, the file is successfully loaded after jQuery core:
wp_enqueue_script( 'common-js-requiring-jquery', site_url() . '/../js/common-js-requiring-jquery.js', array( 'jquery' ) );
I wonder what causes this behaviour.
Does anyone know the reason?
- The topic ‘wp_enqueue_script depenency breaks’ is closed to new replies.