From 57fb217b3fe6701c54972fc56f1b38a310451987 Mon Sep 17 00:00:00 2001 From: azaozz Date: Thu, 16 Oct 2008 20:25:50 +0000 Subject: [PATCH] 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 --- wp-admin/includes/media.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 5486874415..3f6ec828ca 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -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).'"' : '';