Skip to content

Instantly share code, notes, and snippets.

@jdeeburke jdeeburke/functions.php
Last active May 3, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.