justintadlock / get-the-image

Get the Image WordPress plugin.
GNU General Public License v2.0
104 stars 17 forks source link

Tracking images #7

Closed Workshopshed closed 10 years ago

Workshopshed commented 10 years ago

When people use 3rd party services such as Amazon Affiliates they often have a tracking image which is a transparent 1x1 image. It there are no other images on the post get-the-image can end up picking up that image and it get's displayed as the thumbnail.

Example

<img src="http://ir-uk.amazon-adsystem.com/e/ir?t=bagpussandfri-21&amp;l=as2&amp;o=2&amp;a=B00EE6C47I&quot; width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

To exclude these perhaps a filter could be used passing the URL as a parameter. Then users could specifically exclude these by returning false when there was a URL they did not want to include?

justintadlock commented 10 years ago

Is the current filter hook, get_the_image, not good enough to do this already?

Workshopshed commented 10 years ago

For the situation where there is only one image and it's a tracking image then yes it's possible to use that filter and blank out the HTML so that's good for my specific issue.

I was thinking that there might also be an issue where people have a tracking image and a regular image. However I think in at least Amazon's case the "real" image always comes first so that should not be an issue.