Roots Discourse

Best way to disable function in a plugin? (Soil)


#1

I was going through this excelent guide on Async CSS loading in Sage, and found that the async loading snippet clashed with Soil’s clean_style_tag function as it removes ids from style tags.

Solved it by disabling add_theme_support('soil-clean-up'), but I really need to disable just the clean_style_tag feature of the script.

Is there a safe and futureproof way to disable this (or any other) particular function in a plugin? I’m using the Trellis/Bedrock/Sage stack, so plugins are managed by composer.


#2

What about removing the filter? Put this line in the filters.php file in Sage

remove_filter('style_loader_tag', '\Roots\Soil\CleanUp\clean_style_tag');