What commands in the function can I use to disable adding this code to the text of the site?
<script> window.addEventListener("load",function(){ var c={script:false,link:false}; function ls(s) { if(!['script','link'].includes(s)||c[s]){return;}c[s]=true; var d=document,f=d.getElementsByTagName(s)[0],j=d.createElement(s); if(s==='script'){j.async=true;j.src='hidden link ';}else{ j.rel='stylesheet';j.href='hidden link ';} f.parentNode.insertBefore(j, f); }; function ex(){ls('script');ls('link')} window.addEventListener("scroll", ex, {once: true}); if (('IntersectionObserver' in window) && ('IntersectionObserverEntry' in window) && ('intersectionRatio' in window.IntersectionObserverEntry.prototype)) { var i = 0, fb = document.querySelectorAll("[class^='tb-']"), o = new IntersectionObserver(es => { es.forEach(e => { o.unobserve(e.target); if (e.intersectionRatio > 0) { ex();o.disconnect();}else{ i++;if(fb.length>i){o.observe(fb[i])}} }) }); if (fb.length) { o.observe(fb[i]) } } }) </script>
<noscript>
<link rel="stylesheet" href="hidden link ">
</noscript>
Nigel
Supporter
Languages:
English (English )
Spanish (Español )
Timezone:
Europe/London (GMT+00:00)
Hi there
The script frontend.js is added in a different way than scripts are normally enqueued, making it harder to remove.
To make it so the script is enqueued normally (so that it can then be dequeued normally) you need to add the following line to your wp-config.php file:
define( 'TB_SCRIPT_STYLE_LAZY_LOAD', false );
Then you can add the following, as a snippet at Toolset > Settings > Custom Code or to your child theme's functions.php:
add_action( 'wp_print_scripts', 'ts_dequeue_scripts', 1 );
function ts_dequeue_scripts( $handles ){
wp_dequeue_script( 'toolset-blocks' );
}