Expose height and width attributes to 'wp_get_attachment_image_attributes' filter
|Reported by:||divinenephron||Owned by:|
The filter 'wp_get_attachment_image_attributes' allows you to alter the attributes of embedded images. However the height and width attributes aren't passed to this filter. These would be useful to have – I'm making a theme with a fluid layout where I have to remove all height and width attributes to ensure that the browser maintains the attribute of images when they're resized.
I've attached a patch with a fix. In it I've also changed the function 'get_image_tag' so that I could remove the immensely pointless 'hwstring' function.
Change History (18)
- Keywords has-patch filter wp_get_attachment_image_attributes attribute height width attachment removed
comment:3 divinenephron — 4 years ago
- Cc divinenephron added
- Component changed from Plugins to Media
- Keywords has-patch filter wp_get_attachment_image_attributes attribute height width attachment added
- Severity changed from normal to minor
- Keywords filter wp_get_attachment_image_attributes attribute height width attachment removed
- Milestone changed from Awaiting Review to 3.1
- Keywords 2nd-opinion added
- Milestone changed from 3.1 to Future Release