From: Laury GvR Date: Fri, 20 Jul 2018 16:25:26 +0000 (-0400) Subject: Requeue wooSelect scripts to fix checkout select X-Git-Tag: v1.0.6^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=eefd6948457e5dfcdacaf5b592b514cb57a87ec0;p=WP-Themes%2Fmurdicksmackinacfudge.git Requeue wooSelect scripts to fix checkout select Checkout select boxes use woocommerce scripts for their selection dropdown animation, but it breaks in the most recent version. This addition makes sure the scripts are properly loaded, solving the severe style malfunctions seen on the checkout page. --- diff --git a/functions.php b/functions.php index 952c833..d7ca586 100644 --- a/functions.php +++ b/functions.php @@ -324,10 +324,22 @@ if (!function_exists('loop_columns')) { } } - function murdicks_add_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'murdicks_add_woocommerce_support' ); +// Remove CSS and/or JS for Select2 used by WooCommerce to fix selection boxes styles breaking +add_action( 'wp_enqueue_scripts', 'woo_requeue_select_scripts', 100 ); + +function woo_requeue_select_scripts() { + if ( class_exists( 'woocommerce' ) ) { + wp_dequeue_style( 'selectWoo' ); + wp_deregister_style( 'selectWoo' ); + + wp_dequeue_script( 'selectWoo'); + wp_deregister_script('selectWoo'); + } +} + ?> diff --git a/style.css b/style.css index 8ea9830..97d3ece 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: murdicksmackinacfudge Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for Murdick's Mackinac Fudge -Version: 1.0.5 +Version: 1.0.6 */