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