Closed ashthecoder05 closed 11 months ago
Previously we used clear_url filter hook to added the defer attribute to the script tag. Which recently has been deprecated and is generating a invalid url for scripts. It looks something like this
clear_url
<script src="js/checkout.js?ver=3.6.7' defer='defer'"></script>
Now changed this by passing a stratergy defer to the wp_register_script() and this creates the url correctly as below
defer
wp_register_script()
<script src="js/checkout.js?ver=3.6.9" defer="defer" data-wp-strategy="defer"></script>
Previously we used
clear_url
filter hook to added the defer attribute to the script tag. Which recently has been deprecated and is generating a invalid url for scripts. It looks something like thisNow changed this by passing a stratergy
defer
to thewp_register_script()
and this creates the url correctly as below