admin管理员组文章数量:1287858
This is what i am trying to achieve: --
Code i am trying in wordpress:-
function html5_insert_image($html, $id, $caption, $title, $align, $url) {
$html5 = get_image_tag( $id, $alt,$url, '', $align, $size );
$html5 = "<figure id='post-$id media-$id' class='align-$align'>";
$html5 .= "<img src='$url' alt='$title' />";
if ($caption) {
$html5 .= "<figcaption>$caption</figcaption>";
}
$html5 .= "</figure>";
return $html5;
}
add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 );
issue is here url is not getting printed image source ,i tried many code from post from stack or other source but not working.
Or will be best if anyone can help with the code what i wanted. I mean with first example.
Theme support for HTML5 is added theme.
本文标签: How to wrap normal image tag with figure HTML5 element
版权声明:本文标题:How to wrap normal image tag with figure HTML5 element 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741325595a2372460.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论