I've a listing of 6 library i wish to load into my wordpress wordpress plugin/theme. Presently they are all put into the header within the theme like so.

<script type="text/javascript" src="/wp-content/themes/mytheme/js/jquery.wijmo-open.1.2.0.min.js"></script>

I am creating a wordpress plugin that features its own script that is dependent on these librarys. I wish to run with this solution which i develop to ascertain if it complies with wordpress standards. I desired to en-queue the scripts within the theme, to ensure that I possibly could reference them within the wordpress plugin.

Within the theme header, i transformed all <script src> to <? wp_enqueue_script(); ?>.

wp_enqueue_script( 'my-jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js' );
wp_enqueue_script( 'my-jquery-ui-core', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js' );
wp_enqueue_script( 'raphael', '/wp-content/themes/mytheme/js/external/raphael.js', array('wijmo-jquery','wijmo-jquery-ui-core'));
wp_enqueue_script( 'jquery-glob', '/wp-content/themes/mytheme/js/external/jquery.glob.min.js', array('wijmo-jquery','wijmo-jquery-ui-core'));
wp_enqueue_script( 'jquery-bgiframe', '/wp-content/themes/mytheme/js/external/jquery.bgiframe-2.1.3-pre.js', array('wijmo-jquery','wijmo-jquery-ui-core'));
wp_enqueue_script( 'jquery-mousewheel', '/wp-content/themes/mytheme/js/external/jquery.mousewheel.min.js', array('wijmo-jquery','wijmo-jquery-ui-core'));
wp_enqueue_script( 'wijmo-open', '/wp-content/themes/mytheme/js/jquery.wijmo-open.1.2.0.min.js', array('wijmo-jquery','wijmo-jquery-ui-core','raphael','jquery-glob','jquery-bgiframe'));

Within the wordpress plugin I'm able to now reference my wordpress plugin js dependancies jquery-glob, jquery-bgiframe and wijmo-open.

wp_enqueue_script( 'wee_broim_download_form', WP_PLUGIN_URL . '/wee-broim-download-form/js/script.js', array('jquery','jquery-ui-core','raphael','jquery-glob','jquery-bgiframe','jquery-mousewheel','wijmo-open','wijmo-complete'));

I realize wordpress has some built-in librarys, which I'm able to make use of the functions.php to suggest to jquery, jquery ui cdn's etc, however it works best for me just renaming them (my-jquery, my-jquery-ui). I simply thought the way in which I am progressively adding the dependencies was a little untidy. If only there is a method to tell my wordpress plugin, ok, you load last.

You don't have to clearly title all the libraries that the js file is dependent on. For instance:

If library A is dependent on B, and also you want C to become loaded after these 2, you simply need C to rely on A, so that as A is dependent on B, C is going to be loaded last.

Inside your example, that you can do

wp_enqueue_script( 'wee_broim_download_form', WP_PLUGIN_URL . '/wee-broim-download-form/js/script.js', array('jquery-bgiframe','jquery-mousewheel','wijmo-open','wijmo-complete'));

As wijmo_open is dependent around the relaxation libraries you'd.