Changeset 8029

Show
Ignore:
Timestamp:
05/31/08 19:12:55 (6 months ago)
Author:
ryan
Message:

New filter and phpdoc for get_image_tag(). Props jacobsantos. fixes #7065 for trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/media.php

    r7998 r8029  
    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 
     
    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); 
     117 
     118    $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="'.$class.'" />'; 
    100119 
    101120    $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );