If no caption entered, use attachment title for alt text, props Viper007Bond, fixes #7675

git-svn-id: http://svn.automattic.com/wordpress/trunk@9210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-10-16 20:25:50 +00:00
parent 372a721fe0
commit 57fb217b3f
1 changed files with 3 additions and 1 deletions

View File

@ -93,7 +93,9 @@ function the_media_upload_tabs() {
*/
function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') {
$html = get_image_tag($id, $alt, $title, $align, $size);
$htmlalt = ( empty($alt) ) ? $title : $alt;
$html = get_image_tag($id, $htmlalt, $title, $align, $size);
$rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : '';