Skip to content

Instantly share code, notes, and snippets.

@tomhemsley
Created March 7, 2016 11:37
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 tomhemsley/58387b44303a7214cbd5 to your computer and use it in GitHub Desktop.
Save tomhemsley/58387b44303a7214cbd5 to your computer and use it in GitHub Desktop.
Meta Slider Rocket Loader (TEST)
add_filter( 'script_loader_tag', 'disable_async_for_rocket_loader', 11, 2 );
function disable_async_for_rocket_loader( $tag, $handle ) {
if ( strpos( $handle, 'metaslider' ) !== FALSE ) {
$tag = str_replace( "<script type='text/javascript'", "<script data-cfasync='false'", $tag );
}
return $tag;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment