Skip to content

Instantly share code, notes, and snippets.

@jdeeburke
Last active May 3, 2019 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdeeburke/dd70b0efc47ae56e2f8341161e894854 to your computer and use it in GitHub Desktop.
Save jdeeburke/dd70b0efc47ae56e2f8341161e894854 to your computer and use it in GitHub Desktop.
Jilt for WooCommerce Rocket Loader Exclusion
<?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