Php 在wordpress中为img标题标签添加标题

Php 在wordpress中为img标题标签添加标题,php,image,wordpress,lightbox,caption,Php,Image,Wordpress,Lightbox,Caption,我试图在wordpress中将标题添加到图像标题标签中,这样我使用的lightbox就会显示标题,因为它只显示标题标签。我添加了$caption以及从caption短代码借用的许多其他变体。有什么建议吗 function get_image_tag($id, $alt, $title, $align, $caption, $size='medium') { list( $img_src, $width, $height ) = image_downsize($id, $size);

我试图在wordpress中将标题添加到图像标题标签中,这样我使用的lightbox就会显示标题,因为它只显示标题标签。我添加了$caption以及从caption短代码借用的许多其他变体。有什么建议吗

function get_image_tag($id, $alt, $title, $align, $caption, $size='medium') {

    list( $img_src, $width, $height ) = image_downsize($id, $size);
    $hwstring = image_hwstring($width);


    $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
    $class = apply_filters('get_image_tag_class', $class, $id, $align, $size);

    $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" title=" ' . esc_attr($title).' | '. esc_attr($content).'" '.$hwstring.'class="'.$class.'" />';

    $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $caption, $size );

    return $html;
}
函数get\u image\u标记($id、$alt、$title、$align、$caption、$size='medium')){
列表($img_src,$width,$height)=图像缩小($id,$size);
$hwstring=图像_hwstring($width);
$class='align'.esc_attr($align)。'size-'.esc_attr($size)。'wp image-'.$id;
$class=apply_filters('get_image_tag_class',$class,$id,$align,$size);
$html='';
$html=apply_过滤器('get_image_tag'、$html、$id、$alt、$title、$align、$caption、$size);
返回$html;
}

您是编写此函数还是只是修改它?
$caption
参数从何而来?这个问题可以转移到?@lord\u t:*这个jQuery插件的灵感来源于Lokesh Dhakar()*的Lightbox 2,适合我使用,就像jQuery的插件一样。*@名称jquery-lightbox-0.5.js*@作者Leandro Vieira Pinho-我正在尝试修改wp includes/media.php文件中存在的名称。而$caption参数并不是来自任何地方,我只是希望它能起作用。从某种程度上说,我是个php新手。
To add caption to the images being displayed in lightbox.Follow the below steps:


- Go to admin dashboard and click the library,it will list out all uploaded 
  pictures used for lightbox.Then click on the image for which you want to give caption
  Then,that image properties will appear in that caption field is there.
                                [OR]

- You can include caption while adding image itself.For that click the media tab -> add 
  new.Upload New Media will open,in that click select files and load the image from your 
  local machine.After the image is uploaded.Below that image you will see the caption 
  property.