Ticket #7065: media.phpdoc.7065.diff
| File media.phpdoc.7065.diff, 1.8 kB (added by jacobsantos, 6 months ago) |
|---|
-
media.php
old new 90 90 91 91 } 92 92 93 // return an <img src /> tag for the given image attachment, scaling it down if requested 93 /** 94 * An <img src /> tag for an image attachment, scaling it down if requested. 95 * 96 * {@internal Missing Long Description}} 97 * 98 * @uses apply_filters() The 'get_image_tag_class' filter is the IMG element 99 * class attribute. 100 * @uses apply_filters() The 'get_image_tag' filter is the full IMG element with 101 * all attributes. 102 * 103 * @param int $id Attachment ID. 104 * @param string $alt Image Description for the alt attribute. 105 * @param string $title Image Description for the title attribute. 106 * @param string $align Part of the class name for aligning the image. 107 * @param string $size Optional. Default is 'medium'. 108 * @return string HTML IMG element for given image attachment 109 */ 94 110 function get_image_tag($id, $alt, $title, $align, $size='medium') { 95 111 96 112 list( $img_src, $width, $height ) = image_downsize($id, $size); 97 113 $hwstring = image_hwstring($width, $height); 98 114 99 $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.'" />'; 115 $class = 'align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id; 116 $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); 100 117 118 $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="'.$class.'" />'; 119 101 120 $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 102 121 103 122 return $html;
