diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-10 14:08:54 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-10 14:08:54 +0000 |
| commit | 310940b824eff4a116dcd72ccd339bb602021981 (patch) | |
| tree | 19f6efc7b30b9456eebc26d578c5dc7e125bb6e7 /wp-includes/media.php | |
| parent | 616f7399dc4c4f7c56951c7b87a7aa91b3e690a3 (diff) | |
| download | wordpress-mu-310940b824eff4a116dcd72ccd339bb602021981.tar.gz wordpress-mu-310940b824eff4a116dcd72ccd339bb602021981.tar.xz wordpress-mu-310940b824eff4a116dcd72ccd339bb602021981.zip | |
Merge with branches/2.5 in WordPress, revision 8066
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1324 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/media.php')
| -rw-r--r-- | wp-includes/media.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/wp-includes/media.php b/wp-includes/media.php index f43a2f0..dc7da3a 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -90,16 +90,34 @@ function image_downsize($id, $size = 'medium') { } -// return an <img src /> tag for the given image attachment, scaling it down if requested +/** + * An <img src /> tag for an image attachment, scaling it down if requested. + * + * {@internal Missing Long Description}} + * + * @uses apply_filters() The 'get_image_tag_class' filter is the IMG element + * class attribute. + * @uses apply_filters() The 'get_image_tag' filter is the full IMG element with + * all attributes. + * + * @param int $id Attachment ID. + * @param string $alt Image Description for the alt attribute. + * @param string $title Image Description for the title attribute. + * @param string $align Part of the class name for aligning the image. + * @param string $size Optional. Default is 'medium'. + * @return string HTML IMG element for given image attachment + */ function get_image_tag($id, $alt, $title, $align, $size='medium') { list( $img_src, $width, $height ) = image_downsize($id, $size); $hwstring = image_hwstring($width, $height); - $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id.'" />'; + $class = 'align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id; + $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); - $url = ''; - $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); + $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="'.$class.'" />'; + + $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); return $html; } |
