Last active
May 3, 2019 00:52
-
-
Save jdeeburke/dd70b0efc47ae56e2f8341161e894854 to your computer and use it in GitHub Desktop.
Jilt for WooCommerce Rocket Loader Exclusion
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
<?php | |
add_filter( 'script_loader_tag', 'add_rocket_loader_attribute_to_jilt', 10, 3 ); | |
function add_rocket_loader_attribute_to_jilt( $tag, $handle, $src ) { | |
if ( 'wc-jilt' === $handle ) { | |
$tag = '<script data-cfasync="false" type="text/javascript" src="' . esc_url( $src ) . '"></script>'; | |
} | |
return $tag; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment