Created
November 30, 2019 18:58
-
-
Save shirokoweb/5e20bca055033059f97fd34ab73aa672 to your computer and use it in GitHub Desktop.
WordPress shutdown hook to disable WooCommerce get_refreshed_fragments
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 | |
/** Disable Ajax Call from WooCommerce on front page, posts, categories, and tags*/ | |
add_action( 'shutdown', 'dequeue_woocommerce_cart_fragments'); | |
function dequeue_woocommerce_cart_fragments() { | |
if (is_front_page() || is_single() || is_category() || is_tag() ) wp_dequeue_script('wc-cart-fragments'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment