Thread Starter
FS
(@fedsmith)
Update:
I was able to come up with a fix for this. I used the plugin’s filter insert_post_ads_enabled to turn the plugin off for my site’s sidebar and figured out where to hook into the sidebar rendering to have it activate accordingly.
Here’s the code in case it helps anybody else:
function remove_sidebar_ad_code( ) {
add_filter( 'insert_post_ads_enabled', '__return_false' ); // disable insert ads plugin by setting relevant filter to false
}
add_action( 'dynamic_sidebar_before', 'remove_sidebar_ad_code', 10, 2 );