Add the ability to filter wp_get_attachment_image()
|Reported by:||helgatheviking||Owned by:|
i'm working on a plugin that lets users define any image to serve as the thumbnail for any PDF document. I'm storing the ID of the image as post_meta for the PDF attachment. Instead of showing the default icon with wp_get_attachment_image() I'm quite close to being able to do this by filtering image_downsize.
the trouble is that the image_downsize filter it run after
if ( !wp_attachment_is_image($id) ) return false;
so the PDF image fails the test and I never have a chance to run my filter.
Change History (47)
- Component changed from General to Media
4 years ago
- Summary changed from move image_downsize filter to beginning of image_downsize() function to Add the ability to filter wp_get_attachment_image()
2 years ago
- Keywords dev-feedback removed