Not sure what is going on here but I am dequeueing scripts and enfold is just injecting them back into the layout anyway. I’ve tried everything from 9999 to 0 to 5 priority and nothing seems to work. On localhost, it works. On, production, enfold just ignores it.
I’ve verified the dequeue actually runs by dumping scripts to the html using <!–> and i can say for sure things like isotope are not in there. But in the footer there it is: isotope.
<script type="text/javascript" src="/wp-content/themes/enfold_2021/config-templatebuilder/avia-shortcodes/portfolio/isotope.js?ver=5.6.4" id="avia-module-isotope-js"></script>
add_action('wp_print_scripts', 'avia_dequeue_unused_js', 100);
function avia_dequeue_unused_js() {
wp_dequeue_script('avia-module-portfolio');
wp_dequeue_script('avia-module-postslider');
wp_dequeue_script('avia-module-slideshow');
wp_dequeue_script('avia-module-slideshow-video');
wp_dequeue_script('avia-module-isotope');
}
EDIT: nevermind
I think adding masonry to this forced it off the stack. Not sure why localhost was working but here we are:
wp_dequeue_script('avia-module-masonry');
wp_dequeue_script('avia-module-portfolio');
wp_dequeue_script('avia-module-postslider');
wp_dequeue_script('avia-module-slideshow');
wp_dequeue_script('avia-module-slideshow-video');
wp_dequeue_script('avia-module-isotope');
