On older WP versions and ClassicPress, at least. If and only if the image is also one of the post's attached images (which will be the case if it was uploaded through the Create Post screen).
Solution: Cast thumbnail ID to int before comparing it to attached image ID.
On older WP versions and ClassicPress, at least. If and only if the image is also one of the post's attached images (which will be the case if it was uploaded through the Create Post screen).
Solution: Cast thumbnail ID to
int
before comparing it to attached image ID.