Last active
February 11, 2018 09:43
-
-
Save MarkoSh/a00a526fd0b62d68ed20dddde8e74002 to your computer and use it in GitHub Desktop.
WooCommerce total disable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); | |
add_action( 'wp_head', 'disable_woo', 99 ); | |
function disable_woo() { | |
global $wp_scripts, $wp_styles; | |
$scripts = array( | |
'accounting', | |
'wc-jquery-ui-touchpunch', | |
'wc-price-slider', | |
'flexslider', | |
'js-cookie', | |
'jquery-blockui', | |
'jquery-cookie', | |
'jquery-payment', | |
'photoswipe', | |
'photoswipe-ui-default', | |
'prettyPhoto', | |
'prettyPhoto-init', | |
'select2', | |
'selectWoo', | |
'wc-address-i18n', | |
'wc-add-payment-method', | |
'wc-cart', | |
'wc-cart-fragments', | |
'wc-checkout', | |
'wc-country-select', | |
'wc-credit-card-form', | |
'wc-add-to-cart', | |
'wc-add-to-cart-variation', | |
'wc-geolocation', | |
'wc-lost-password', | |
'wc-password-strength-meter', | |
'wc-single-product', | |
'woocommerce', | |
'zoom' | |
); | |
foreach ( $scripts as $script ) { | |
wp_dequeue_script( $script ); | |
wp_deregister_script( $script ); | |
} | |
$styles = array( | |
'photoswipe', | |
'photoswipe-default-skin', | |
'select2', | |
'woocommerce_prettyPhoto_css', | |
'woocommerce-layout', | |
'woocommerce-smallscreen', | |
'woocommerce-general' | |
); | |
foreach ( $styles as $style ) { | |
wp_dequeue_style( $style ); | |
wp_deregister_style( $style ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment