Created
June 15, 2017 04:57
-
-
Save mariadanieldeepak/01d63ba2e5ab48b45029119feaa98d80 to your computer and use it in GitHub Desktop.
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
function add_async_attribute( $tag, $handle ) { | |
if ( 'my-google-adsense-js' !== $handle) { | |
return $tag; | |
} else { | |
return str_replace(' src', ' async="async" src', $tag); | |
} | |
} | |
apply_filters( 'script_loader_tag', 'add_async_attribute' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment