Alt text for images wrong or empty in wp_get_attachment_image()
|Reported by:||kallewangstedt||Owned by:|
When wp_get_attachment_image() is called, it generates the alt-text from the post_excerpt field instead of the (new) postmeta field with meta_key "_wp_attachment_image_alt". This causes the alt text to not be set even though the media editor clearly states that the "Alternate text" field is being used as alt text for the image.
I have attached a patch that corrects this by calling get_post_meta() instead of post_excerpt inside the function.
As a fallback it would be good to expand the function to check if there is an alt-text entry, and if not use the caption (post_excerpt) field instead, or if only the Title is set use that.
The alt text should not be empty at all.