Ah. Those pesky ad blockers. I’m very familiar with them and the problems they can cause because I have another plugin that detects them.
I can’t think of a way to make the whole ad block automatic stripping work all the time. Ad blockers don’t announce when they’ve removed something. But I do have two suggestions that would work almost every time. I don’t want to make them part of the plugin because it’s beyond the scope of it, but you might be able to take advantage of them on your own.
The suggestions are similar, but I think the first is better for your case.
1.) Use JavaScript to look to see if the <div>s are empty, and if so, hide them. You can put the following JavaScript in your theme somewhere, and I believe it will hide boxes emptied by that ad blocker.
jQuery("div.TT_wrapper").each(function() {
var hidett = false;
if(jQuery.trim(jQuery(this).text()) == "") {
hidett = true;
}
if(jQuery.trim(jQuery("div.TT_text", this).text()) == "") {
hidett = true;
}
if(hidett) {
jQuery(this).remove();
}
});
I haven’t tested this personally, but from what you described, I think it will work.
———————–
2.) Use my ad block detection plugin I mentioned and tie it in with Tweet This. It will be easier to understand what I am about to say if you look at it first. It’s called Ad Blocking Detector.
Copy and paste the Tweet This shortcode that is being blocked into a new Ad Blocking Detector shortcode’s “No Ad Blocker Detected” field, give the new shortcode a name, and leave all the other fields blank. Then save the shortcode. Now, in your theme where you are trying to put this Tweet This shortcode, put the Ad Blocking Detector shortcode instead. When it doesn’t find any ad blockers, the Tweet This shortcode will display. When it does find ad blockers, nothing will display.
I don’t think this is your best choice because not all ad blockers empty your Tweet This box, yet Ad Blocking Detector will hide it every time it finds an ad blocker. The first suggestion only hides it when it’s empty.
——————–
Neither suggestion is completely reliable. They both depend on your site’s visitors having JavaScript turned on (which will be the vast, vast majority) and the ad blocker working a certain way. But if you’re set on using blockable content in the Tweet This box, these will work for most people.