wp_enqueue_script ignoring jquery-ui packages
-
I am loading js scripts for a plugin I have, and in about 2% of my installs, the jquery-ui packages are getting ignored and not loaded. Here is an example of the function I am hooking to:
public function addAdminScripts() { // jquery ui wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-dialog'); wp_enqueue_script('jquery-ui-slider'); wp_enqueue_script('jquery-ui-autocomplete',array('jquery')); wp_enqueue_script('jquery-ui-accordion',array('jquery')); wp_enqueue_script('jquery-ui-tabs',array('jquery')); wp_enqueue_script('jquery-ui-datepicker',array('jquery')); wp_enqueue_script('jquery-ui-droppable',array('jquery')); wp_enqueue_script('jquery-ui-progressbar',array('jquery')); wp_enqueue_script('jquery-validate-js',BREW_MODULES_URL.'Core/assets/js/jquery.validate.min.js', array('jquery'), BREW_ASSET_VERSION); wp_enqueue_script('ib-jquery-serialize-object', BREW_MODULES_URL.'Core/assets/third-party/jquery-serialize-object/jquery.serialize-object.js', array('jquery'), BREW_ASSET_VERSION); wp_enqueue_script('ib-core-js', BREW_MODULES_URL.'Core/assets/js/core.js',array('jquery'), BREW_ASSET_VERSION); wp_enqueue_script('ib-tabs-jquery-js', BREW_MODULES_URL.'Core/assets/js/ib-tabs.jquery.js', array('jquery'), BREW_ASSET_VERSION); wp_enqueue_script('ib-form-validator', BREW_MODULES_URL.'Core/assets/js/ib-form-validation.js',array('jquery'), BREW_ASSET_VERSION, true ); wp_enqueue_script('ib-ajax-handler-js', BREW_MODULES_URL.'Core/assets/js/ib-ajax-handler.js',array('jquery','ib-form-validator'), BREW_ASSET_VERSION, true ); wp_enqueue_script('ib-confirm-js', BREW_MODULES_URL.'Core/assets/js/jquery.confirm.js', array('jquery'), BREW_ASSET_VERSION); wp_enqueue_script('clipboard-min-js', BREW_MODULES_URL.'Core/assets/js/clipboard.min.js', array('jquery'), BREW_ASSET_VERSION); wp_enqueue_script('jquery-tipsy-js', BREW_MODULES_URL.'Core/assets/js/jquery.tipsy.js', array('jquery'), BREW_ASSET_VERSION); // data tables wp_enqueue_script('data-tables-js',BREW_MODULES_URL.'Core/assets/third-party/DataTables-1.10.12/jquery.dataTables.js', array('jquery'), BREW_ASSET_VERSION); wp_enqueue_script('ib-datatables-col-reorder', BREW_MODULES_URL.'Core/assets/third-party/DataTables-1.10.12/dataTables.colReorder.js', array('data-tables-js'), BREW_ASSET_VERSION); // resize wp_enqueue_script('ib-col-resize', BREW_MODULES_URL.'Core/assets/third-party/jquery-colresize/colResizable-1.6.js', array('jquery'), BREW_ASSET_VERSION); wp_localize_script( 'ib-ajax-handler-js', 'ibAjax', array( 'ajaxurl' => admin_url('admin-ajax.php'), ) ); if(@$_GET['page'] == "inboundbrew"){ wp_enqueue_script('ib-wizzard-js', BREW_MODULES_URL.'Core/assets/js/ib-wizzard.js',array('jquery'), BREW_ASSET_VERSION, true ); } }
All of the custom scripts that are unique to my plugin are getting loaded just fine. I can debug and echo in that function and it is getting called appropriately.
In most of my clients and others installs, the “load-scripts.php” call includes the jquery-ui packages just fine. However, in one my devs local env and one of my clients sites that I have found, “load-scripts.php” does not have the jquery-ui components listed as arguments.
I have already deactivated all other plugins and even tried different themes to rule that out. I am at a total loss.
Thoughts?
- The topic ‘wp_enqueue_script ignoring jquery-ui packages’ is closed to new replies.