Ticket #7065: media.phpdoc.2.5.2.diff

File media.phpdoc.2.5.2.diff, 1.8 kB (added by jacobsantos, 6 months ago)

Patch for 2.5 branch based off of r8027

  • media.php

    old new  
    9090 
    9191} 
    9292 
    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 */ 
    94110function get_image_tag($id, $alt, $title, $align, $size='medium') { 
    95111 
    96112        list( $img_src, $width, $height ) = image_downsize($id, $size); 
    97113        $hwstring = image_hwstring($width, $height); 
    98114 
    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); 
    100117 
     118        $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="'.$class.'" />'; 
     119 
    101120        $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 
    102121 
    103122        return $html;