Last active
January 2, 2019 10:38
-
-
Save gregrickaby/2852142 to your computer and use it in GitHub Desktop.
Remove ALL WooCommerce scripts and styles.
This file contains 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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
/** | |
* Remove all WooCommerce scripts and styles! Forever! | |
* | |
* @author WP Smith | |
* @since 1.0.0 | |
*/ | |
function grd_remove_woocommerce_styles_scripts() { | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); | |
remove_action( 'wp_enqueue_scripts', array( $GLOBALS['woocommerce'], 'frontend_scripts' ) ); | |
} | |
define( 'WOOCOMMERCE_USE_CSS', false ); | |
add_action( 'init', 'grd_remove_woocommerce_styles_scripts', 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment