﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
19013	wp_get_attachment_image not working as expected	ramaboo		"Assume the following bit of code:

wp_get_attachment_image(1, 'thumbnail', false, array('title' => 'fobar'));

It will produce something like this:
<img width=""150"" height=""150"" src=""http://testcrave.genome.ramaboo.com/wp-content/uploads/2011/10/DC040811-RW23-150x150.jpg"" class=""attachment-thumbnail"" alt=""DC040811 RW23 150x150 gallery"" title=""foobar"" />

as expected!

Now try this:
wp_get_attachment_image(1, 'thumbnail', false, array('alt' => 'fobar'));

and the result is:
<img width=""150"" height=""150"" src=""http://testcrave.genome.ramaboo.com/wp-content/uploads/2011/10/DC040811-RW23-150x150.jpg"" class=""attachment-thumbnail"" alt=""DC040811 RW23 150x150 gallery"" title=""DC040811-RW23"" />

I would expect it to honor the alt attribute but instead the system uses the default alt attribute. According to the documentation http://codex.wordpress.org/Function_Reference/wp_get_attachment_image passing in array('alt' => 'foobar') for $attr should be valid.

I also tried it with array('class' => 'foobar') and array('foo' => 'foobar') and both worked as expected. The only one I have found that does not work is array('alt' => 'foobar').

David

"	defect (bug)	closed	normal		General		normal	invalid	reporter-feedback	
