So I am using the http://woothemes.com/woocommerce/ plugin for eCommerce and it's registering jQuery local and conflicting with my default jQuery call from Google CDN.
It took a long time but I isolated the issue to the following lines of code within woocommerce.php:
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
$lightbox_en = (get_option('woocommerce_enable_lightbox')=='yes') ? true : false;
$chosen_en = (get_option('woocommerce_enable_chosen')=='yes') ? true : false;
$jquery_ui_en = (get_option('woocommerce_enable_jquery_ui')=='yes') ? true : false;
$scripts_position = (get_option('woocommerce_scripts_position') == 'yes') ? true : false;
// Woocommerce.min.js is minified and contains woocommerce_plugins
wp_enqueue_script( 'woocommerce', $this->plugin_url() . '/assets/js/woocommerce'.$suffix.'.js', array('jquery'), '1.0', $scripts_position );
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
wp_enqueue_script( 'woocommerce_plugins', $this->plugin_url() . '/assets/js/woocommerce_plugins'.$suffix.'.js', array('jquery'), '1.0', $scripts_position );
}
Deleting them cancels out the duplicate jQuery call which is causing me all my headaches. I have the following in functions.php to dequeue jQuery from the header, but for some reason, it persistsand refuses to go away! :/ Any ideas how to kill the local jQuery call from within functions.php? Is there something wrong with my code? :
// dequeue jquery from header
function theme_slug_dequeue_header_jquery() {
wp_dequeue_script( 'jquery' );
}
add_action( 'wp_header', 'theme_slug_dequeue_header_jquery', 11 );